Constants - The Go Programming Language
go.dev · 3,984 words · saved by 1 readers
An introduction to constants in Go.
Constants - The Go Programming Language The Go Blog Constants Rob Pike 25 August 2014 Introduction Go is a statically typed language that does not permit operations that mix numeric types. You can't add a float64 to an int , or even an int32 to an int . Yet it is legal to write 1e6*time.Second or math.Exp(1) or even 1<<(' '+2.0) . In Go, constants, unlike variables, behave pretty much like regular numbers. This post explains why that is and what it means. Background: C In the early days of thinking about Go, we talked about a number of problems caused by the way C and its descendants let you m
related reading
- Frequently Asked Questions (FAQ) - The Go Programming Languagego.dev
- Constants and statics - Rust for C-Programmersrust-for-c-programmers.com
- The Laws of Reflection - The Go Programming Languagego.dev
- The Go Programming Language Specification - The Go Programming Languagego.dev
- Go类型系统概述 -Go语言101gfw.go101.org
- Data types - Rust for C-Programmersrust-for-c-programmers.com
- Variables and Mutability - The Rust Programming Languagedoc.rust-lang.org
- Effective Go - The Go Programming Languagego.dev
- Notes on structured concurrency, or: Go statement considered harmful - njs blogvorpus.org
- Go Slices: usage and internals - The Go Programming Languagego.dev
- Demystifying Function Parameters in Go- Alex Edwardsalexedwards.net
- Go's Declaration Syntax - The Go Programming Languagego.dev