Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
6
Task/Literals-String/Go/literals-string-1.go
Normal file
6
Task/Literals-String/Go/literals-string-1.go
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
ch := 'z'
|
||||
ch = 122 // or 0x7a or 0172 or any other integer literal
|
||||
ch = '\x7a' // \x{2*hex}
|
||||
ch = '\u007a' // \u{4*hex}
|
||||
ch = '\U0000007a' // \U{8*hex}
|
||||
ch = '\172' // \{3*octal}
|
||||
14
Task/Literals-String/Go/literals-string-2.go
Normal file
14
Task/Literals-String/Go/literals-string-2.go
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
ch := 'z' // ch is type rune (an int32 type)
|
||||
var r rune = 'z' // r is type rune
|
||||
var b byte = 'z' // b is type byte (an uint8 type)
|
||||
b2 := byte('z') // equivalent to b
|
||||
const z = 'z' // z is untyped, it may be freely assigned or used in any integer expression
|
||||
b = z
|
||||
r = z
|
||||
ch2 := z // equivalent to ch (type rune)
|
||||
var i int = z
|
||||
const c byte = 'z' // c is a typed constant
|
||||
b = c
|
||||
r = rune(c)
|
||||
i = int(c)
|
||||
b3 := c // equivalent to b
|
||||
3
Task/Literals-String/Go/literals-string-3.go
Normal file
3
Task/Literals-String/Go/literals-string-3.go
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
str := "z"
|
||||
str = "\u007a"
|
||||
str = "two\nlines"
|
||||
1
Task/Literals-String/Go/literals-string-4.go
Normal file
1
Task/Literals-String/Go/literals-string-4.go
Normal file
|
|
@ -0,0 +1 @@
|
|||
str := "日本語"
|
||||
1
Task/Literals-String/Go/literals-string-5.go
Normal file
1
Task/Literals-String/Go/literals-string-5.go
Normal file
|
|
@ -0,0 +1 @@
|
|||
`\n` == "\\n"
|
||||
2
Task/Literals-String/Go/literals-string-6.go
Normal file
2
Task/Literals-String/Go/literals-string-6.go
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
`abc
|
||||
def` == "abc\ndef", // never "abc\r\ndef" even if the source file contains CR+LF line endings
|
||||
Loading…
Add table
Add a link
Reference in a new issue