28 lines
306 B
Go
28 lines
306 B
Go
package main
|
|
|
|
import (
|
|
"fmt"
|
|
"strconv"
|
|
)
|
|
|
|
const (
|
|
A = 10
|
|
B = 11
|
|
)
|
|
|
|
func main() {
|
|
|
|
var constInt8 int8 = A
|
|
var constString string = strconv.Itoa(A)
|
|
|
|
fmt.Println("constInt8 is ",constInt8)
|
|
fmt.Println("constString is ",constString)
|
|
|
|
}
|
|
|
|
func checkConst() {
|
|
if A == 10 {
|
|
fmt.Printf("a is 10\n")
|
|
}
|
|
}
|