Files
headfirstgo/chapter4/const/const.go
2025-01-30 12:04:39 +03:00

19 lines
397 B
Go
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package main
import "fmt"
// объявление константы с типом
const TriangleSides int = 3
// объявление константы без типа
const SquareSides = 4
/* константам переназначить значение невозможно
const PentagonSides = 5
PentagonSides = 6 // error
*/
func main() {
fmt.Println(TriangleSides, SquareSides)
}