package main
func main() {
var name string = "nico"
name = 12 // 12는 숫자라서 안된다.
name = "12" // 다른 string으로 업데이트는 가능
name := "nico" // 이렇게 선언도 가능
name = 12 // 숫자는 여전히 불가능
age := 12 //int
age = "12" //string이라서 불가능
}
package main
const name string = "nico"
func main() {
name = "lalala" //const는 수정 불가
}
bool
string
int int8 int16 int32 int64
uint uint8 uint16 uint32 uint64 uintptr
byte // alias for uint8
rune // alias for int32
// represents a Unicode code point
float32 float64
complex64 complex128
uint8 unsigned 8-bit integers (0 to 255)
uint16 unsigned 16-bit integers (0 to 65535)
uint32 unsigned 32-bit integers (0 to 4294967295)
uint64 unsigned 64-bit integers (0 to 18446744073709551615)
int8 signed 8-bit integers (-128 to 127)
int16 signed 16-bit integers (-32768 to 32767)
int32 signed 32-bit integers (-2147483648 to 2147483647)
int64 signed 64-bit integers (-9223372036854775808 to 9223372036854775807)
강의 출처 : 노마드코더(https://nomadcoders.co)
[Nomad Coin] Tour of Go - #3.4 Slices and Arrays (0) | 2022.07.10 |
---|---|
[Nomad Coin] Tour of Go - #3.3 fmt (0) | 2022.07.10 |
[Nomad Coin] Tour of Go - #3.2 functions (0) | 2022.07.10 |
[Nomad Coin] Tour of Go - #3.0 Creating the Project (0) | 2022.07.10 |
[Nomad Coin] Introduction (0) | 2022.07.09 |
댓글 영역