11 ms·
Go 1.8 Release Candidate 1 is released
- XorNot 10y agoNo mention if this is picking up the fix for the goroutine stack corruption issue in the release notes.
- alpb 10y agoYou're right. I think it is included: https://github.com/golang/go/commit/b902a63ade47cf69218c9b38c9a783fc8cfc3041 https://github.com/golang/go/commit/b902a63ade47cf69218c9b38... (see the end of the commit message)
- nishs 10y ago> The GOPATH environment variable now has a default value if it is unset. It defaults to $HOME/go on Unix and %USERPROFILE%/go on Windows. [0] Finally. This is going to make it easier for newcomers to the Go ecosystem, since commands such as "go get" will now work out of the box. [0] https://beta.golang.org/doc/go1.8#gopath https://beta.golang.org/doc/go1.8#gopath
- sofaofthedamned 10y agoBiggest thing on this release to be fair. Unbelievably simply but so effective, about time.
- voidlogic 10y agoWhat about the 5-10% performance boost? For me thats like getting a few hundred thousand dollars worth of free hardware...
- k2xl 10y agoEveryone I know who has learned Go has encountered this issue. "What's this GOPATH env variable? What should it be set to?" When I personally learned Go this (and how go do/doesn't do vendoring) was the hardest thing to learn. It's strange that it took this long to get this feature out. Now if they could figure out a way to get go get to work nicely with private repos out of the box without SSH config hacks that'd be great..
- deleted 10y ago[deleted]
- ashark 10y agoI like Go, but the GOPATH thing gave a very bad first impression.
- tedunangst 10y agoCurious why they didn't pick something like .go to be more out of the way.
- stouset 10y agoBecause it's supposed to be your actual development workspace. To be honest, I think this is one of the most asinine parts of the go development workflow (and there are a lot of contenders…). Having to organize all your go projects separately from everything else just because they happen to be developed in that particular language is maddening.
- fixermark 10y agoJava seems to have gone that road. Not sure if it was a bad idea or not.
- Psyonic 10y agoIn what way did Java go that road? Java doesn't impose any constraint on location across projects.
- StevePerkins 10y agoWhat are you talking about? It's simple to mix Java and C++ (or whatever) within the same project. Wellllllllll... until you actually start to write code against JNI, of course. But the project LAYOUT is simple!
- wtetzner 10y ago> Wellllllllll... until you actually start to write code against JNI, of course. JNA[1] makes things much simpler. [1] https://github.com/java-native-access/jna https://github.com/java-native-access/jna
- Manishearth 10y agoYeah, this gets super annoying when you need your project written in other languages to contain go code. I worked on the YCM support for godef, we eventually had to fork the library and rewrite paths since there was no way of pinning to a version within YCM. Libraries written with github paths for `go get` do not play nice with living outside of gopath, and libraries written with relative paths don't work with go get (even though this is something that go could support)
- echelon 10y agoWhy does Go require a special path for projects to be on? Python doesn't. Rust doesn't. This just seems annoying for no particular reason.
- majewsky 10y agoIndeed. I have a couple of Go projects that are released in the classical manner as tarballs, which users can extract anywhere and compile with `make && make install`. This used to work okay-ish until Go 1.5. Then Go 1.6 introduced vendoring support (i.e. you put the code for the libraries you need into your own repo) which is very nice if it works, so I wanted to have it. But `go build` stubbornly refuses to look at vendored code when you are not in the exact correct location inside the GOPATH. To preserve the familiar build semantics, I set up the GOPATH inside the repo. Roughly like this: $ git clone https://github.com/foo/bar && cd bar $ mkdir -p .gopath/src/github.com/foo $ ln -sTf ../../../.. .gopath/src/github.com/foo/bar $ GOPATH=$PWD/.gopath go build github.com/foo/bar Of course, all that bullshit can be nicely tugged away in the Makefile. For example: https://github.com/sapcc/swift-drive-autopilot/blob/a3d5d02ba86d59c6aa7aadbc9bfcef8b527bffa4/Makefile https://github.com/sapcc/swift-drive-autopilot/blob/a3d5d02b... You can find this either hilarious or sad. I like the irony in using make(1) to patch up the deficiencies of a tool that was created decades after it.
- ernsheong 10y agoThere is a tool called gb that helps you with this https://getgb.io/ https://getgb.io/ (I have no affiliation with gb)
- majewsky 10y agoWhile we're shamelessly plugging: I actually wrote my own vendoring tool after being confused by the ecosystem. It's a shell script of maybe 30 LOC: https://github.com/holocm/golangvend/blob/master/golangvend https://github.com/holocm/golangvend/blob/master/golangvend I hope to abandon it for an official solution, though, given that it appears and is good.
- 10y ago
- krakensden 10y agoArg, that's my GOROOT. For a while it was going to be ~/gocode, when did it get changed?
- amckinlay 10y agoAnd why not ~/Library/ for Mac?
- gjvc 10y agoThink I would have preferred $HOME/lib/go/ on UNIX ...
- fnord123 10y agoXDG doesn't have a XDG_LIB_HOME but I would guess it should be $HOME/.local/lib
- julio83 10y agoGo 1.8 will be the last release to support Linux on ARMv5E and ARMv6 processors: Go 1.9 will likely require the ARMv6K (as found in the Raspberry Pi 1) or later. Does this mean that we will not be able to produce ARMv5 binaries or this is only a prerequisite for the compiler?
- deleted 10y ago[deleted]
- rcarmo 10y agoHmmm. If that's true, then I won't be able to build binaries for my old Synology anymore.
- bostand 10y agoMore importantly, the cross platform router worm that was ddos-ing everyone a few months back was written in go and will not be able to upgrade to 1.8 :)
- julio83 10y agoAnd IoT companies will have to put trust in another language. We deployed hundreds of ARM5 gateways accross Africa with a golang stack. This kind of decision is not compliant with serious IoT HW providers. Software is easy to upgrade, hardware not. Now we have to bet on another language... welcome rust?
- bostand 10y agoTo be fair, you should expect that from any Google project. Remember their popular RSS reader service? If you think this change is crazy, wait until they reveal the changes they have planned for android later this year.
- zzzcpan 10y agoThey already dropped support for older freebsd systems and at some point discussed to drop freebsd as a first-class target. Already hard to judge the risks for non amd64-linux systems.
- sentiental 10y agoOne thing that might snag web applications built with Go 1.8 is the change to the html/template library. If you ever need to include script templates in your HTML for usage by a Javascript template framework (in my case it was EJS), then you will need to be aware that html entities will be escaped in a way they were not in 1.7 Given the following literal: <script type="text/javascript"> <div><%= something %></div> </script> Go 1.8 will escape the EJS delimiter, breaking the template. I.e.: <script type="text/javascript"> <div><%= something %></div> </script> I selected EJS specifically because I wanted a templating library that didn't conflict with html/template's handlebars syntax. If you're in the same boat you'll want to find a template engine with non-html entity delimiters.
- bostand 10y agoThat's odd, that should not happen. If it is true, please don't use the text template as a quick fix. A lot if security thinking went into the html template and without it you will have xss all over your code. Edit: sure enough, it validates type against know values and I assume jsx is not over of them.
- chrisbroadfoot 10y agoShouldn't you use a different "type"? What you're putting in there is not JavaScript, it's something else. Use <script type="text/ejs">?
- grey-area 10y agoBut it does become javascript so it needs the right script type. A way to work around this might be to do this: <script type="<%= js_mime %>"> <div><%= something %> then it won't be escaped presumably as js, but it will become js when it is run through the other templating system. sentiental have you tried that approach?
- grey-area 10y agoJust had a look at your issue: https://github.com/golang/go/issues/18569 https://github.com/golang/go/issues/18569 I think your comment above isn't quite right. The problem you're seeing is that previously this was escaped as js (incorrect), and now it is escaped as text (correct). If you set your type as above to "text/javascript", it works in go 1.8: <script type="text/javascript"> <div><%= something %></div> </script> on 1.8 outputs: <script type="text/javascript"> <div><%= something %></div> </script> the one that fails is if you set the type to text/template or similar, which makes sense I guess as it is not js but might be annoying if your library uses <> as delimiters. Should work with text/template though if you mark those snippets as template.HTML type before including in an html/template.
- sjezewski 10y agoThere was talk of the go team deciding on a vendoring paradigm. I don't see any mention in the release notes. Anyone have ideas/updates on how much closer we're getting to an official vendoring decision?
- jrallison 10y agoFinalized in go1.7 https://beta.golang.org/doc/go1.7#cmd_go https://beta.golang.org/doc/go1.7#cmd_go
- stablemap 10y agoThere is a committee working on it. Here's a detailed update from last month: https://blog.gopheracademy.com/advent-2016/saga-go-dependency-management/ https://blog.gopheracademy.com/advent-2016/saga-go-dependenc...
- travisby 10y agoWhat a blockbuster release (candidate). Congrats golang team! I can't wait to start adding in the mutex contention to our tests, remove our custom graceful http shutdown library, compile 15% faster, start using context within our queries, write custom comparators [I needed this just last week! We had a type that already implemented the sort interface, but I needed to sort it by a different key in this one-off] for sorting, and have a much better time debugging JSON unmarshalling. And those were just the big pieces I noticed that will be an immediate improvement!
- reikonomusha 10y agoFinally, in 2017, we can write custom comparators.
- steeve 10y agoA nice comment which adds nothing. On a side note, you always could.
- junke 10y ago> On a side note, you always could. Yes, with brand new sorter types for each different comparison. Knowing that Go had first-class functions from the beginning, it is actually quite surprising that a higher-order sort function didn't already exist.
- radimm 10y agodocumentation for customer comparators?
- junke 10y agohttps://beta.golang.org/doc/go1.8#sort_slice https://beta.golang.org/doc/go1.8#sort_slice
- lsllc 10y agoThe new plugin package is only supported on Linux? ... hopefully this is just an rc1 limitation.
- bradfitz 10y agoIt was going to be Linux & Mac at least, but Mac support was removed at the final hour due to bugs. Go 1.8 will be Linux-only. Go 1.9 should add Mac support back, and hopefully Windows if the right people have time to work on it.
- FiloSottile 10y agoYou can easily install the RC as its own binary with the new awesome version tool: $ go get golang.org/x/build/version/go1.8rc1 $ go1.8rc1 download $ go1.8rc1 version go version go1.8rc1 darwin/amd64 $ go1.8rc1 build ...
- buckhx 10y agoWhat's a good version manager that allows me to jump versions without moving my whole workspace over? Currently using gvm which installs and runs different versions fine, but whenever you switch version you have to move your entire workspace over or download all your packages again. Any ideas?
- volker48 10y agohttps://news.ycombinator.com/item?id=13370206 https://news.ycombinator.com/item?id=13370206
- madlynormal 10y agohttps://github.com/cryptojuice/gobrew https://github.com/cryptojuice/gobrew might work.
- JulianVModesto 10y agogvm! https://github.com/moovweb/gvm https://github.com/moovweb/gvm
- buckhx 10y agoI'm using gvm now, but updating your workspace is very tedious. Here's the related issue https://github.com/moovweb/gvm/issues/189 https://github.com/moovweb/gvm/issues/189, also I'm not convinced gvm is maintained anymore.
- omginternets 10y ago>Note that many common MIPS-based routers lack an FPU and have firmware that doesn't enable kernel FPU emulation; Go won't run on such machines. I'm considering using Go for a small service that would live on my OpenWRT router. What does this mean for me?
- codehusker 10y agoNothing. OpenWRT enables Linux's FPU emulation. Depending on your hardware, you may run into issues with the size of Go binaries. Off topic: If you use OpenWRT, check out the LEDE Project. It's a fork and development appears more active, but no stable releases yet.
- omginternets 10y agoGreat, thanks! Also, could you enlighten me as to the meaning behind the FPU acronym? Edit: found it -- disregard my last. Floating Point Unit.
- maddyboo 10y agoIt would be neat if there was a Go Playground running the latest beta/RC version of Go. (Or is there?) I wanted to quickly test out the new struct type conversion behavior and obviously my code[1] doesn't compile on the normal playground. Perhaps interesting to note, the `beta.golang.org`[2] homepage specifically adds an inline `display:none` style to the div containing the mini Go Playground which is normally on the `golang.org`[3] homepage - removing that style in the Chrome inspector, you can see the mini Playground, but it doesn't work. Upon closer inspection, the code to init the playground is still there, but the `playground.js` script isn't – the init code, however, checks for this so it doesn't throw any errors. I like the attention to detail, at least – you don't want the homepage for a beta version to have the plaground running the current stable release version; that would be pretty confusing. Still, I wonder why the HTML and JS initialization code for the playground is still there? If they went through the effort to add a `display:none` style to the HTML and a condition to check if the Playground script is available, why not just remove it entirely? Just my random thoughts - obviously not a big deal at all, I just found it interesting! [1] https://play.golang.org/p/_OSA3O2vTR https://play.golang.org/p/_OSA3O2vTR [2] https://beta.golang.org/ https://beta.golang.org/ [3] https://golang.org/ https://golang.org/
- f2f 10y ago> It would be neat if there was a Go Playground running the latest beta/RC version of Go. (Or is there?) umm, no, not automagically. the playground is restricted. it would require some work to be put in to make it work with the latest release. that work isn't available for free.
- maddyboo 10y agoThis is why I don't comment on HN. Maybe I'm stupid and just always make stupid comments, but I think the attitude you displayed with your "umm, no" is way too common around here. Is it too hard for you to not be condescending when making a counter argument? Edit: After re-reading both my comment and yours, I'm not sure if you were using the "umm, no" innocently in response to the `(Or is there?)` at the end of my sentence, or if you were trying to say it in a condescending way. I'll give you the benefit of the doubt and assume it was the former. I'm not trying to be one of those SJW people who gets offended at any little thing. Regarding the rest of your comment: > the playground is restricted What exactly do you mean by that? > automagically And that? I'm referring to large RCs like this. I think a lot of people want to test out new features/changes without pulling the latest version to their machine right away. That work is going to have to be done anyway before the final release, right? And I can't really imagine it would be a lot of work, I would think _maybe_ a few things would break, but otherwise it should work? And if you think I mean to have the normal `play.golang.org` start using the latest RC, that's not what I mean - I would imagine it would either be on a separate subdomain, like `play.beta.golang.org`. Or, have a dropdown on the main Playground, but that might be potentially confusing?