Go Release Notes
Maintenance Versions:
- go1.25, first release: 2025-08-12, last update: go1.25.0 (2025-08-12)
- go1.24, first release: 2025-02-11, last update: go1.24.6 (2024-08-06)
Go official release notes: Release History - The Go Programming Language
Go official uses semantic versioning for version identification, format is vMAJOR.MINOR.PATCH (see Semantic Versioning), MAJOR version update means Breaking Change occurred, i.e., updates that are not backward compatible, MINOR version update means new features added while maintaining backward compatibility, PATCH version update means problems fixed while maintaining backward compatibility.
Go team releases a MINOR version every six months, and only the latest two MINOR versions are long-term maintained, maintenance time is six months each. Given that Go maintains quite high compatibility with every update, it is recommended to upgrade Go to the latest version in time after the new version is stable.
The last time Go 2.0 proposed a draft was on November 19, 2018, when it was still at go1.13 version. Five years later, the version has iterated to go1.21. Various ideas of Go 2.0 have been reflected in Go 1.0 through incremental updates. One of the founders also explicitly stated that there may not be Go 2.0 in the future, and Go will continue to strive to maintain backward compatibility (see Go 1 and Future of Go Programs).
Tip
This page is just a simple repost of the official log, not updated regularly. To get the latest news, please go to the official website.
1.25
First release: 2025-08-12
Last update: go1.25.0 (2025-08-12)
For detailed release notes of go1.25 version, go to Go 1.24 Release Notes to view. For all patch versions released during its maintenance period, go to Go1.25 - Release Patch to learn.
Language Level
- Removed the concept of core type in generics (core type), see official blog post Goodbye core types
Standard Library
- Added
test/synctestfor testing concurrent code - Added experimental library
encoding/json/v2, which includes:encoding/json/v2, deserialization speed is about 2-10 times faster than v1, see benchmark go-json-experiment/jsonbenchencoding/json/jsontext, provides low-level interaction capability with json strings
Toolchain
- Subsequent Go releases will include a small number of pre-built binary tools
- go mod added
ignoredirective to specify folders that go command should ignore go doc -httpcan start a local http server to view code documentation- go vet added
waitgroupandhostportanalyzers - When go command updates go version in
go.modorgo.work, it no longer adds specified go toolchain version
Runtime
GOMAXPROCS will perceive container CPU limits in container environments
New experimental GC
greenteagc, GC's basic scheduling unit changed from object to memory spanWhen panic is not caught, it no longer prints repeatedly
panic: PANIC [recovered] panic: PANICchanges to
panic: PANIC [recovered, repanicked]Added
runtime/trace.FlightRecorder, capable of continuously capturing runtime execution information in a lighter way
Compiler
Fixed the bug of 1.21 null pointer delayed check (delayed until after error check), the following code that has obvious problems at first glance could run normally before version 1.25
gopackage main import "os" func main() { f, err := os.Open("nonExistentFile") name := f.Name() if err != nil { println("should panic") // This line will be output before 1.25 return } println(name) }Compiler will reserve more backing memory for slices on the stack to improve usage performance
Support generating DWARF5 debug information
1.24
First release: 2025-02-11
Last update: go1.24.6 (2025-08-06)
For detailed release notes of go1.24 version, go to Go 1.24 Release Notes to view. For all patch versions released during its maintenance period, go to Go1.24 - Release Patch to learn.
Language Level
Generic type aliases, allowing creating aliases for generic types, which is very useful when referencing third-party defined generic types, for example
goimport ( "other" ) type MyQueue[T any] = other.Queue[T]
Standard Library
- Added
weakpackage: provides weak pointers (Weak Pointers), allowing objects to be referenced without increasing reference count, avoiding memory leaks caused by caching. Need to check if pointer isnilbefore use - File system access restrictions: introduced
os.Roottype to limit file operations within specific directories, enhancing security - Encryption and hash support: added
crypto/mlkem,crypto/hkdf,crypto/pbkdf2andcrypto/sha3packages, optimized performance of existing encryption algorithms - Added benchmark testing function
testing.B.Loopfor better loop testing encoding/json: addedomitzerotag, supports zero value filtering based onIsZero()methodstringsandbytes: added iterator functions (such asLines,SplitSeq,FieldsSeq)
Runtime
- Rebuilt built-in map based on Swiss Tables, large map access speed improved by 30%, iteration speed improved by 10%-60%
sync.Mapchanged to use concurrent hash trie (hash-trie) to optimize performance, especially in concurrent write scenarios- Runtime internal mutexes use new spinbit implementation, reducing lock contention and improving performance in high concurrency scenarios
- Optimized small object allocation strategy, reducing memory fragmentation and GC pause time
- Added
runtime.AddCleanupto replaceruntime.SetFinalizer, supporting registering multiple cleanup functions for objects and executing them sequentially in independent goroutines
Cgo
- Support
#cgo noescapeand#cgo nocallbackannotations, declaring C functions do not escape memory and do not callback Go functions respectively, improving runtime performance - Cgo now refuses to compile calls to C functions with multiple incompatible declarations, strictly detecting incompatible C function declarations across files (such as
void f(int)andvoid f(double)), avoiding generating incorrect call sequences
工具链
- Module tool dependency management: track tool dependencies through go.mod's tool directive, replacing traditional tools.go empty import scheme
- Structured output: go build and go test support -json flag, output JSON format build and test results
- Compilation and linking optimization: compiler generated code efficiency improved, linker by default generates GNU Build ID (ELF platform) and UUID (macOS)
- Prohibit bypassing method definition restrictions for CGO generated types through aliases
go buildautomatically embeds version control system information into binary files (support-buildvcs=falseto disable)GOAUTHenvironment variable supports private module authentication.go.modsupportstooldirective to manage executable dependencies, replacingtools.goempty white import- Added
go get -toolparameter andgo install toolcommand to manage module tool dependencies - Build cache supports binary caching for
go runandgo tool objdumpsupports LoongArch, RISC-V, S390X disassemblyvetaddedtestsanalyzer (detects test function signature errors)
Platform Compatibility
- macOS: Go 1.24 is the last version to support macOS 11 Big Sur, Go 1.25 will require macOS 12+
- Windows: marked 32-bit ARM architecture as incomplete (GOOS=windows GOARCH=arm), see issue #70705
- Linux: minimum kernel version requirement upgraded to 3.2
- Requires Go 1.22.6+ as bootstrap toolchain
Deprecated
math/rand.Seed()completely invalid, need to restore old behavior throughGODEBUG=randseednop=0.runtime.GOROOT()marked as deprecated, recommended to get path throughgo env GOROOT
1.23
First release: 2024-08-13
Last update: go1.23.4 (2024-12-03)
For detailed release notes of go1.23 version, go to Go 1.23 Release Notes to view. For all patch versions released during its maintenance period, go to Go1.23 - Release Patch to learn.
Language Level
for range supports iterator functions, for detailed information see Go Wiki: Rangefunc Experiment.
gofunc Upper(s []string) iter.Seq2[int, string] { return func(yield func(int, string) bool) { for i, s1 := range s { if !yield(i, strings.ToUpper(s1)) { return } } return } } func main() { sl := []string{"hello", "world", "golang"} for i, s := range Upper(sl) { fmt.Printf("%d : %s\n", i, s) } } //0 : HELLO //1 : WORLD //2 : GOLANGThis is a relatively practical feature, generally used in combination with generics.
Standard Library
Added standard library
iter, which defines and describes detailed information about iteratorsmapslibrary added several iterator functionssliceslibrary added several iterator functionsAdded
structslibrary, providing ability to modify struct attributes, such as memory layoutgotype Person struct { Name string Age int _ structs.HostLayout }Optimized implementation of
timestandard library
Linker
Handle abuse of
//go:linkname, for some frequently referenced APIs temporarily allow their existence, such asruntime.memhash64,runtime.nanotime, etc. After this, other new references will not be allowed.go//go:linkname gcinit runtime.gcinit func gcinit() func main() { gcinit() }Code like this cannot pass compilation
link: main: invalid reference to runtime.gcinit
Toolchain
- Added
go telemetrycommand for telemetry data management
1.22
First release: 2024-02-06
Last update: go1.22.6 (released 2024-08-06)
For detailed release notes of go1.22 version, go to Go 1.22 Release Notes to view. For all patch versions released during its maintenance period, go to Go1.22 - Release Patch to learn.
Language Level
Solved the go language loop variable problem
gofunc main() { var wg sync.WaitGroup const n = 10 wg.Add(n) for i := 0; i < n; i++ { go func() { fmt.Println(i) wg.Done() }() } wg.Wait() }This code will output 10 9s before 1.22, and will normally output 0 to 9 after 1.22.
for rangenow supports iterating numeric types, as followsgofor i := range 10 { fmt.Println(i) }
Standard Library
Enhanced routing of
net/httpstandard librarydatabase/sqladdedsql.Nullgeneric typegotype Null[T any] struct { V T Valid bool }Usage as follows
gotype Person struct { Name sql.Null[string] Age sql.Null[int] }
1.21
First release: 2023-08-08
Last update: go1.21.13 (released 2024-08-06)
For detailed release notes of go1.21 version, go to Go 1.21 Release Notes to view. For all patch versions released during its maintenance period, go to Go1.21 - Release Patch to learn.
Language Level
Added two built-in functions
min,max, for calculating maximum and minimum values.Added built-in function
clear, for clearing map and sliceUpdated
packageinitialization order- Sort all packages by import path
- Repeat execution until the package list is empty
- Find the first package in the list where all imports have been initialized
- Initialize that package and remove it from the list
Improved and enhanced type inference ability and precision, mainly generics related.
Released preview version of
for rangeloop variable improvement, this is a problem that has plagued Go developers for nearly ten years, the official finally solved it, details see: LoopvarExperiment · golang/go Wiki (github.com) and Proposal: Less Error-Prone Loop Variable Scoping (googlesource.com)Guaranteed that
recover's return value will not benil, if parameter isnilwhen callingpanic, it will trigger anotherpanic, returning*runtime.PanicNilError. For compatibility, settingGODEBUG=panicnil=1at compile time allows passingniltopanic.
Standard Library
- Added
log/sloglibrary, providing standard structured logging library - Added
testing/slogtestlibrary, for verifyingslog.Handlerimplementation - Added
sliceslibrary, providing a series of generic functions for operating slices. - Added
mapslibrary, providing a series of generic functions for operating map - Added
cmplibrary, for comparing ordered types.
Other
- go1.21.0 at least requires win10 or Windows Server 2016 version or above to run on windows system, previous versions are no longer supported.
- go1.21.0 at least requires macOS 10.15 Catalina or newer version to run, previous versions are no longer supported.
- Added experimental WebAssembly System Interface, Go is still constantly exploring in WASM.
- In 1.20 it was still experimental (Profile-guided optimization) PGO (see Profile-guided optimization - The Go Programming Language), 1.21 version officially enabled it. Including
default.pgofile in main package will enable this feature, after enabling performance may improve by 2%-7%. - When printing very deep runtime call stacks, changed from originally printing only the first hundred frames to now printing the first 50 and the last 50 frames respectively.
- Optimized CGO call performance on Unix platform, optimized from 1-3 microseconds to now 100-200 nanoseconds.
- In 1.21 version, compilation speed improved by nearly 6%, this is mainly attributed to the compiler itself being built using PGO.
1.20
First release: 2023-02-01
Last update: go1.20.14 (released 2024-02-06)
For detailed release notes of go1.20 version, go to Go 1.20 Release Notes to view. For all patch versions released during its maintenance period, go to Go1.20 - Release Patch to learn.
Language Level
- When converting slice type to array, originally needed to dereference pointer array
*(*[4]byte)(x)to avoid operating same underlying array with slice, now can write directly like[4]byte(x). unsafeaddedSliceData,String,StringDatafunctions, for building and structuring slice and string values.
Standard Library
- Added
crypto/ecdhlibrary, providing support for ECDH (Elliptic Curve Diffie-Hellman, a non-symmetric encryption method). - go1.20 extended support for error wrapping, allowing one error to wrap multiple errors.
- Added
net/http.ResponseController, providing a clearer, more discoverable way to add per-handler controls. httputil.ReverseProxyincludes a new Rewrite Hook function, replacing the previous Director Hook.
Other
- go1.20 is the last version to support win7, 8, Server2008 and Server2012, future versions will no longer provide support.
- go1.20 is the last version to support macOS 10.13 or 10.14, future versions will no longer provide support.
- In 1.18 and 1.19 versions, due to appearance of generics, compared to 1.17 compilation speed appeared regression, go1.20 compilation speed will improve by about 10%.
- Released preview version of PGO (Profile-guided optimization), this is a compiler optimization technology in computer field, can improve runtime performance.
- In go1.20, on systems without C toolchains, go command disables cgo.
- Support collecting program code coverage files, see Coverage profiling support for integration tests - The Go Programming Language
- Made improvements to GC, improved stability, reduced memory overhead, improved overall 2% CPU performance.
1.19
First release: 2022-08-02
Last update: go1.19.13 (released 2023-09-06)
For detailed release notes of go1.19 version, go to Go 1.19 Release Notes to view. For all patch versions released during its maintenance period, go to Go1.19 - Release Patch to learn.
Important Changes
Memory model aligns with c/c++, similar to TcMollcate
sync/atomicpackage now provides more types available for useSupport using
runtime/debug.SetMemoryLimitfunction to perform soft limit on go memory, in some cases can improve memory utilization efficiencyRuntime will now choose an appropriate size to initialize stack space memory based on average usage of goroutine stack, this can avoid frequent stack expansion and contraction
1.18
First release: 2022-03-15
Last update: go1.18.10 (released 2023-01-10)
For detailed release notes of go1.18 version, go to Go 1.18 Release Notes to view. For all patch versions released during its maintenance period, go to Go1.18 - Release Patch to learn.
Language Level
- Heavyweight update, supports generics, type set interfaces, parameter type constraints
Other
- Optimized
appendfunction's expansion behavior - Added
debug/buildinfopackage, can get go program's build information at runtime - gofmt can now format source files concurrently
1.17
First release: 2021-08-16
Last update: go1.17.13 (released 2022-08-01)
For detailed release notes of go1.17 version, go to Go 1.17 Release Notes to view. For all patch versions released during its maintenance period, go to Go1.17 - Release Patch to learn.
Language Level
- Added
unsafe.Addfunction, supports pointer arithmetic - Added
unsafe.Slicefunction, supports getting pointer of slice's underlying array - Slice can now be converted to array pointer type,
[]T => *[N]T, provided that array length is less than or equal to slice length
1.16
First release: 2021-02-16
Last update: go1.16.15 (released 2022-03-03)
For detailed release notes of go1.16 version, go to Go 1.16 Release Notes to view. For all patch versions released during its maintenance period, go to Go1.16 - Release Patch to learn.
Important Changes
This version has no important syntax changes, some important changes are as follows
- Deprecated
ioutilpackage - Support embedding some static files into program through
//go:embeddirective - Added
io/fs.Fstype, better abstraction for file system
1.15
First release: 2020-08-11
Last update: go1.15.15 (released 2021-08-05)
For detailed release notes of go1.15 version, go to Go 1.15 Release Notes to view. For all patch versions released during its maintenance period, go to Go1.15 - Release Patch to learn.
Important Changes
This version has no important syntax changes, some important changes are as follows
Optimized small object allocation efficiency
Added package
time/tzdata, supports embedding timezone database into program through following way, because many systems locally do not have timezone data information.goimport _ "time/tzdata"Made major improvements to go linker, reduced its resource usage and improved code robustness
In some cases, allow
unsafe.Pointerto convert touintptr
1.14
First release: 2020-02-25
Last update: go1.14.15 (released 2021-02-04)
For detailed release notes of go1.14 version, go to Go 1.14 Release Notes to view. For all patch versions released during its maintenance period, go to Go1.14 - Release Patch to learn.
Language Level
Support method set interface type nesting
gotype MyIO interface { io.WriteCloser }
Other
- Introduced open coding optimization,
defercall overhead reduced to almost same as native call - Support asynchronous preemption between goroutines, loops without function calls will no longer permanently block scheduling
1.13
First release: 2019-09-03
Last update: go1.13.15 (released 2020-08-06)
For detailed release notes of go1.13 version, go to Go 1.13 Release Notes to view. For all patch versions released during its maintenance period, go to Go1.13 - Release Patch to learn.
Language Level
Support more modern numeric literals, such as
go0b101 // binary 0o10 // octal 0x1B // hexadecimalSupport underscore separation of numbers to bring better readability
go10_000Imaginary number
isuffix can now be any binary, octal, hexadecimal, or floating point number
Other
GO111MODULEvalue defaults toauto- Added
GOPRIVATEenvironment variable to support private dependency sources - Added
GOSUMDBenvironment variable deferusage overhead reduced by 30%- When index out of bounds occurs,
panicnow prints index information - Go performs semantic version verification when downloading dependencies
1.12
首次发布:2019-02-25
最后更新:go1.12.17 (released 2020-02-12)
go1.12 版本的详细更新日志可以前往Go 1.12 Release Notes查看,在其维护期间发布的所有补丁版本可以前往Go1.12 - Release Patch了解。
重要变化
该版本没什么重要的语法上的变更,一些重要的变化如下
- 显著提高了堆的扫描性能
- 运行时将更积极的向操作系统释放申请的内存
- 用于下载 go 依赖的命令现在可以并发安全的使用
1.11
首次发布:2018-08-24
最后更新:go1.11.13 (released 2019-08-13)
go1.11 版本的详细更新日志可以前往Go 1.11 Release Notes查看,在其维护期间发布的所有补丁版本可以前往Go1.11 - Release Patch了解。
重要变化
This version has no significant syntax changes; the key updates are as follows
- GoMod was introduced for the first time, ending the previous chaos in dependency management
- First experimental support for WASM
- The runtime adopted a sparse heap layout, removing the heap-size limit
1.10
First release: 2018-02-16
Last update: go1.10.8 (released 2019-01-23)
go1.10 版本的详细更新日志可以前往Go 1.10 Release Notes查看,在其维护期间发布的所有补丁版本可以前往Go1.10 - Release Patch了解。
Important Changes
This version has no significant syntax changes; the key updates are as follows
go installcommand now only used to install and compile command-line tools, no longer used to download dependenciesgo getcommand now used to download source dependencies- go testing now caches test results, and automatically runs
go vetbefore running tests - Significantly reduced the delay caused by GC when active
1.9
First release: 2017-08-24
Last update: go1.9.7 (released 2018-06-05)
For detailed release notes of go1.9, please visit Go 1.9 Release Notes; for all patch versions released during its maintenance period, please check Go1.9 - Release Patch.
Language Level
- Support type aliases
Other
- Support parallel compilation
- Introduced concurrent-safe
sync.Map
1.8
First release: 2017-02-16
Last update: go1.8.7 (released 2018-02-07)
For detailed release notes of go1.8, please visit Go 1.8 Release Notes; for all patch versions released during its maintenance period, please check Go1.8 - Release Patch.
Language Level
When two structs are converted to each other, the difference in struct tags is ignored
gofunc example() { type T1 struct { X int `json:"foo"` } type T2 struct { X int `json:"bar"` } var v1 T1 var v2 T2 v1 = T1(v2) // now legal }
Other
- Garbage collection pause time is low to 10 microseconds, much lower than 100 microseconds in most cases (can see almost every version of go improving GC)
deferusage overhead is reduced by half- Go calling C's overhead is reduced by half
- Optimized concurrent use detection of maps
1.7
First release: 2016-08-15
Last update: go1.7.6 (released 2017-05-23)
For detailed release notes of go1.7, please visit Go 1.7 Release Notes; for all patch versions released during its maintenance period, please check Go1.7 - Release Patch.
Important Changes
golang.org/x/net/contextis now part of the standard library- gc time is significantly shorter than 1.6
testingpackage supports subtests
1.6
First release: 2016-02-17
Last update: go1.6.4 (released 2016-12-01)
go1.6 版本的详细更新日志可以前往Go 1.6 Release Notes查看,在其维护期间发布的所有补丁版本可以前往Go1.6 - Release Patch了解。
Important Changes
This version has no significant syntax changes; the key updates are as follows
- Concurrent use detection of maps has been significantly improved, and if a map is used concurrently, a
fatalerror will be thrown - When
panicoccurs, only the call stack of the current goroutine will be printed - HTTP/2 is supported
1.5
First release: 2015-08-19
Last update: go1.5.4 (released 2016-04-12)
For detailed release notes of go1.5, please visit Go 1.5 Release Notes; for all patch versions released during its maintenance period, please check Go1.5 - Release Patch.
Language Level
In map literal initialization, the element type can be omitted
gom := map[Point]string{ Point{29.935523, 52.891566}: "Persepolis", Point{-25.352594, 131.034361}: "Uluru", Point{37.422455, -122.084306}: "Googleplex", } // 省略类型 m := map[Point]string{ {29.935523, 52.891566}: "Persepolis", {-25.352594, 131.034361}: "Uluru", {37.422455, -122.084306}: "Googleplex", }
Other
- The runtime and compiler are completely rewritten in go, no longer containing any c code
- Concurrent garbage collection is supported, significantly reducing the pause time of the program
- The default value of
GOMAXPROCSis the number of logical cores of the machine - The semantic of
internalpackage can be applied to any package, not just the source code package of go - Experimental support for vendor dependency management (finally started to handle dependency management)
1.4
First release: 2014-12-10
Last update: go1.4.3 (released 2015-09-22)
For detailed release notes of go1.4, please visit Go 1.4 Release Notes; for all patch versions released during its maintenance period, please check Go1.4 - Release Patch.
Language Level
for rangeloop can have one iteration parameter, such asfor i := range x { ... }but not none
When calling methods of double pointer types, no automatic dereferencing is performed
gotype T int func (T) M() {} var x **T // not allowed x.M()
Other
- In previous versions of go, the runtime was written in c, and now it is completely written in go
- The package name can be changed to
internalto represent that all its contents are private and unexported
1.3
First release: 2014-06-18
Last update: go1.3.3 (released 2014-09-30)
For detailed release notes of go1.3, please visit Go 1.3 Release Notes; for all patch versions released during its maintenance period, please check Go1.3 - Release Patch.
Important Changes
This version has no significant syntax changes; the key updates are as follows
- Concurrent use detection of maps has been significantly improved, and if a map is used concurrently, a
fatalerror will be thrown - When
panicoccurs, only the call stack of the current goroutine will be printed - HTTP/2 is supported
1.2
First release: 2013-12-01
Last update: go1.2.2 (released 2014-05-05)
For detailed release notes of go1.2, please visit Go 1.2 Release Notes; for all patch versions released during its maintenance period, please check Go1.2 - Release Patch.
Language Level
When operating on a variable with a value of
nil, apanicwill be thrownWhen slicing a slice, you can use the third parameter to limit the capacity of the sliced slice to ensure safe use of the slice
govar array [10]int slice := array[2:4:4]
Other
The minimum memory size of a goroutine stack has been raised from 4KB to 8KB
The maximum number of threads has been limited to 10000
Long-running goroutines will be preempted when they make function calls (first introduction of cooperative preemption)
1.1
First release: 2013-05-13
Last update: go1.1.2 (released 2013-08-13)
For detailed release notes of go1.1, please visit Go 1.1 Release Notes; for all patch versions released during its maintenance period, please check Go1.1 - Release Patch.
Language Level
- A number divided by 0 will throw a
panicbefore go1.1, but now it cannot be compiled. - Methods can exist as values.
- Introduced the concept of terminating statements, and the return rules of functions are more relaxed, Terminating Statements - go-sepc.
Performance
- Using the go1.1 toolchain to compile go programs can roughly improve performance by 30%-40%
Other
- On 64-bit machines, the maximum heap memory size has been raised to dozens of GB
- By default, cgo is disabled when cross-compiling
1.0
First release: 2012-03-28
Last update: go1.0.3 (released 2012-08-02)
Language Level
- In preview version, a number divided by 0 will throw a
panicbefore go1.0, but now it cannot be compiled. - Methods can exist as values.
- Introduced the concept of terminating statements, and the return rules of functions are more relaxed, Terminating Statements - go-sepc.
Compared to the preview version, the following things have been added to the syntax
Added built-in
appendfunction to add elements to a sliceAdded built-in
closefunction to close a channelCompound semantics, when initializing slice, map, struct literal elements, you can omit their types, as shown below
go// Declare type holiday1 := []Date{ Date{"Feb", 14}, Date{"Nov", 11}, Date{"Dec", 25}, } // Omit type holiday2 := []Date{ {"Feb", 14}, {"Nov", 11}, {"Dec", 25}, }In
initfunction, goroutines will be started directly, without waiting for all packages to be initialized.Added
runetype to represent a UTF-8 characterAdded
errorbuilt-in interface to represent error typeAdded
deletebuilt-in function to delete key-value pairs in mapThe order of iterating map using
for rangebecomes unpredictableSupport multiple variable assignment at once
a := 1 b := 2 a, b = 3, 4Variable shadowing problem: when a function has named return values, if any of the return values are hidden, then the
returnstatement must carry return values, otherwise the compilation will fail, the following is an error examplegofunc Bug() (i, j, k int) { for i = 0; i < 5; i++ { for j := 0; j < 5; j++ { // Redeclares j. k += i * j if k > 100 { return // Rejected: j is shadowed here. } } } return // OK: j is not shadowed here. }Allow copying struct values with private fields
In the case where struct and slice are composed of comparable elements, they are allowed to be used as map keys at the same time, and the comparable property of functions and maps is removed
Except for the language level, go1.0 has changed significantly in terms of package organization, standard library, and command line compared to the preview version. Since the content is too much to cover here, please refer to the official website for more details.
pre
Before go1 was released, all versions were called preview versions. For these preview versions, the official website will release a snapshot version every week. Some important versions are as follows
- r60(2011-09-07), which requires that the else block now must be bracketed
- r59(2011-08-01), which designs a new struct tag scheme
- r58(2011-06-29), which fixes the problem of memory not being initialized when using goto abuse, and adds gui, exec packages
- r57(2011-05-03), which supports short variable multiple assignment syntax, re-designs http, reflect packages, and makes gotest a go program rather than a shell script
- r56(2011-03-07), which is the first stable version
Development of the preview versions began on December 9, 2009, and ended with the official release of Go 1 on March 28, 2012, lasting nearly three years; afterward, weekly snapshots were no longer recorded. Visit Pre-Go 1 Release History for information on these major versions, and Weekly Snapshot History for the full list of weekly snapshots of all preview versions.
