mirror of
https://github.com/golang/go
synced 2024-11-18 05:54:49 -07:00
6105e8b419
First, remove the randomization of initialization order. Then, revert to source code order instead of sorted package path order. This restores the behavior that was in 1.12. A larger change which will implement the suggestion in #31636 will wait for 1.14. It's too complicated for 1.13 at this point (it has tricky interactions with plugins). Fixes #31636 Change-Id: I35b48e8cc21cf9f93c0973edd9193d2eac197628 Reviewed-on: https://go-review.googlesource.com/c/go/+/178297 Run-TryBot: Keith Randall <khr@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
21 lines
498 B
Go
21 lines
498 B
Go
// Copyright 2019 The Go Authors. All rights reserved.
|
|
// Use of this source code is governed by a BSD-style
|
|
// license that can be found in the LICENSE file.
|
|
|
|
package main
|
|
|
|
// We want the initializers of these packages to occur in source code
|
|
// order. See issue 31636. This is the behavior up to and including
|
|
// 1.13. For 1.14, we will move to a variant of lexicographic ordering
|
|
// which will require a change to the test output of this test.
|
|
import (
|
|
_ "c"
|
|
|
|
_ "b"
|
|
|
|
_ "a"
|
|
)
|
|
|
|
func main() {
|
|
}
|