๐Ÿ“ฆ karalabe / go-init-bug

Go compiler init order bug

โ˜… 2 stars โ‘‚ 0 forks ๐Ÿ‘ 2 watching
๐Ÿ“ฅ Clone https://github.com/karalabe/go-init-bug.git
HTTPS git clone https://github.com/karalabe/go-init-bug.git
SSH git clone git@github.com:karalabe/go-init-bug.git
CLI gh repo clone karalabe/go-init-bug
Pรฉter Szilรกgyi Pรฉter Szilรกgyi Oh my 2ccf7b4 1 years ago ๐Ÿ“ History
๐Ÿ“‚ main View all commits โ†’
๐Ÿ“ bad
๐Ÿ“ good
๐Ÿ“„ go.mod
๐Ÿ“„ main.go
๐Ÿ“„ README.md
๐Ÿ“„ README.md

The good and bad package contains the exact same code, but the build order of the files is different (a.go renamed to c.go in one vs the other). You can flip the faulty/good behavior in those packages by renaming the files.

% go run main.go

Good order: 220
Bad order:  0