5 ms·
Alias declarations were reverted from 1.8 recently[0] [0] https://github.com/golang/go/commit/87f4e36ce7d7dffbf1f2a869f3014321f6cfff3c https://github.com/golan
by rusht 10y ago
Alias declarations were reverted from 1.8 recently[0]
[0] https://github.com/golang/go/commit/87f4e36ce7d7dffbf1f2a869f3014321f6cfff3c https://github.com/golang/go/commit/87f4e36ce7d7dffbf1f2a869...
- speps 10y agoGood, one of Go's strength is easy refactoring given that the standard library includes its own parser and syntax packages. If something gets renamed, just write a small script to replace all references...
- lloeki 10y agoHint: https://godoc.org/golang.org/x/tools/cmd/gorename https://godoc.org/golang.org/x/tools/cmd/gorename
- ptman 10y agohttps://www.reddit.com/r/golang/comments/5b5via/alias_declarations_reverted_from_18/d9muilp/ https://www.reddit.com/r/golang/comments/5b5via/alias_declar...
- Sphax 10y agoIt's coming back in Go 1.9
- rusht 10y agoI thought the implementation was still up for discussion so I doubt it has been assigned a release yet, do you have a source?
- Sphax 10y agoI inferred it from the comments here: https://github.com/golang/go/issues/16339#issuecomment-258527920 https://github.com/golang/go/issues/16339#issuecomment-25852... But of course it can still change.
- speps 10y agoThanks for the links, I understand the issue a bit more. I am still not convinced it's the right solution though. Why not a compile time option?
- KirinDave 10y agoBut that doesn't scale at all unless you can push it back out. Aliasing and running this script both imply long term maintenance commitments, but the script is alot more invasive and requires a lot more work because its semantics are defined over the whole language as a transformer rather than as a single feature inside the compiler. I think people suggesting a transformer script are inviting Go back into the dark pre-vendor days when every dependency got out of date rapidly and builds were "losable".