
Go 1.12 Released - crawshaw
https://blog.golang.org/go1.12
======
FiloSottile
_o/ hello HN, this release ships with seamless opt-in support for TLS 1.3 in
crypto/tls. (Gated by the GODEBUG=tls13=1 environment variable.)

I'd be happy to answer any questions about it, or about the rest of the Go
cryptography libraries!

~~~
yesenadam
OK thanks, basic question, but.. What is TLS?

~~~
wereHamster
The S in HTTPS. The technology that is securing your HTTP connections, but
also used by other protocols.

[https://en.wikipedia.org/wiki/Transport_Layer_Security](https://en.wikipedia.org/wiki/Transport_Layer_Security)

~~~
yesenadam
Oh ok.. thank you! (Somehow I'd never heard of that.)

~~~
mholt
Cool, that means that browser developers and web server developers are doing
their jobs halfway right :)

~~~
yesenadam
hehe I guess so. Was a bit shocked to read SSL is deprecated! Still had that
on my "Things to learn about one day" list! ...Ah, I did get this error trying
to curl something earlier today "error:1407742E:SSL
routines:SSL23_GET_SERVER_HELLO:tlsv1 alert protocol version" \- seems my
computer hasn't heard of it either.

~~~
mcpherrinm
SSL and TLS are really the same protocol, except that newer versions are
called TLS. Many software stacks still refer to both as SSL, but these days we
only use TLS.

My understanding is that the renaming was mostly politics between Microsoft,
Netscape, and the IETF in the 90s. See more details here:
[http://tim.dierks.org/2014/05/security-standards-and-name-
ch...](http://tim.dierks.org/2014/05/security-standards-and-name-changes-
in.html)

------
networkimprov
Go 1.12 fixes a bug in os.File.Sync() on MacOS, which didn't actually fsync()
properly.

This affects several popular database libraries.

[https://github.com/golang/go/issues/26650](https://github.com/golang/go/issues/26650)

------
saagarjha
> libSystem is now used when making syscalls on Darwin, ensuring forward-
> compatibility with future versions of macOS and iOS. The switch to libSystem
> triggered additional App Store checks for private API usage. Since it is
> considered private, syscall.Getdirentries now always fails with ENOSYS on
> iOS.

Hooray! I'm surprised it took as long as it did, since IIRC this was something
that broke constantly…

~~~
weberc2
I’ve only heard of one or two breakages...

~~~
geodel
Well, in internet parlance its broken every single time. On the other hand if
I like something then broken thing will always work flawlessly for me

------
boyter
Perfect timing for me. I was just about to push out a new release for my code
counter [https://github.com/boyter/scc](https://github.com/boyter/scc)

It appears to be ~3-4 ms faster when counting repositories like redis which is
rather nice for me as a free speed boost. Probably related to the changes to
GC listed here
[https://golang.org/doc/go1.12#runtime](https://golang.org/doc/go1.12#runtime)

~~~
scottlamb
I'm impressed every release by Go's GC improvements. IIRC, they started with a
terrible conservative GC. It was slow and (particularly on 32-bit platforms)
ineffective. But then they made it increasingly precise, then targeted 10 ms
pause times, then sub-millisecond, and so on. All with far fewer knobs than
the Oracle JVM.

I understand there's still a cost compared to non-GCed languages, but I think
it's mostly RAM usage (perhaps affecting CPU cache effectiveness and thus
efficiency) rather than tail latency.

~~~
bpye
I feel that Go really excells in getting out of your way. I rarely find myself
fighting with the language or runtime. The few occasions I have have been
related to native interop and generally mean I'm having to look at the
internal fields of slices or strings to modify data effeciently, and even that
isn't too diffit.

~~~
kasey_junk
I _often_ find myself fighting with the language but the runtime more than
makes up for it.

In particular the GC & thread scheduler are great. The fact that they are
accessible and digestible by the average go dev is so impressive a testament
to their authors and their focus.

------
denormalfloat
Glad to see syscall/js is still seeing updates. This seems like a excellent
chance to share server and client code by being able to cross compile to wasm.

Go team: please reduce the binary size of wasm files!

~~~
agnivade
The large binary size is mainly due to the Go runtime being packed into the
binary itself. You can compile with "-ldflags -s" to make it slightly smaller.
But it will almost never be comparable to Rust/Emscripten binary sizes.

OTOH, there is a new project called TinyGo
([https://tinygo.org](https://tinygo.org)) which generates LLVM byte code from
Go. This allows a subset of the Go spec, sans any GC or runtime, and generates
binaries comparable to Rust/Emscripten.

------
1_000_000
Honest question for core devs: why do you need my phone number and address to
accept any code and pull requests?

~~~
bradfitz
I was the one who converted Google's CLA system from "Please fax us this form"
to a web form. At the time (2007, 2008?) I added all the fields from the fax
template to the web form. But we dropped the phone number & physical address
years ago. And they were optional even before that.

Nowadays we ask for your name, email address, and optional GitHub username.

------
bouncycastle
Fmt will print maps out in sorted order? I guess that will confuse many
newcomers even more

~~~
entity345
To me it's a deeper issue that this and breaches the single responsibility
principle.

fmt should only print, not manipulate the data it is asked to print.

I believe that the spec says that maps iterate over keys effectively at random
and so that should be the result of any operation that iterates over keys.

~~~
martingxx
The `fmt` packages is described as being for "formatted i/o". It seems that
ordered maps, while not "i/o" is reasonable to describe as "formatting", so
it's fine to do it in this package I think.

`fmt` has always made things look prettier, that's part of what formatting is
about.

You could equally argue that `fmt` should not round floats or pad numbers with
zeros or spaces.

~~~
entity345
Formatting and making things prettier is not manipulation. When I call a
function called "fmt.Println" is expect it to print, not sort.

~~~
weberc2
As far as I can tell, it’s not manipulating, it’s _formatting in sorted
order_.

~~~
entity345
Sorting is manipulating...

~~~
skywhopper
The data itself is not being "manipulated", though. By definition it is
unordered. You are not guaranteed that whatever order you get when iterating
the keys will remain the same. But any string rendering of the map would put
the keys in an "order" and thus would be "manipulating" the data according to
you. Why not have the order be useful to humans?

~~~
entity345
I'm very surprised by those vitriolic comments...

Really I have never seen print change the order of the data it is given
(that's manipulating, indeed) for the sake of what seems to be laziness.

If there is a real need for sorted iteration then it should be external to
print, possibly a new API of maps.

~~~
OskarS
You're missing the point entirely. Maps have no defined order. You cannot
"change" the order of a map, because it has no order. `[foo:1 bar:2]` is the
same map as `[bar:2 foo:1]`, there is no difference.

For printing purposes that means that it doesn't matter which order you print
something out in. ANY order is equally correct. So you might as well choose
the one that makes the most sense to human eyes, which is to print them out
ordered alphabetically on the keys.

Just because the printing function is choosing alphabetical order to print
things out in, it's not "manipulating" anything. Literally nothing about the
map changes.

~~~
entity345
> You're missing the point entirely. Maps have no defined order. You cannot
> "change" the order of a map, because it has no order.

Clearly, I am not the one missing the point...

The order maps iterate is not the point. The point is that e.g. a 'print'
function should print, not sort and change the order.

> just because the printing function is choosing alphabetical order to print
> things out in, it's not "manipulating" anything

Again, the printing function does not 'choose', it manipulates the date
returned by sorting them.

My point is that, to follow good design principle, this sorted iteration
should be a public API of maps.

------
bithavoc
This is so great, although I tried to update my docker container and the
official docker container is still in rc.

~~~
mrweasel
I had to check what the Go docker image does.... It does NOTHING, it just
builds and installs Go, why would you even need a container for this?

~~~
fwip
Either as a base for a development environment, or a disposable container to
compile your go programs.

For example, compiling your program with a different version of Go can be done
just by changing the tag on your compile command, and doesn't require that you
have any development tools or compilers installed on your machine (except
docker).

------
arleny
Been meaning to make the dive into learning Go for a while now. My semester is
finally slowing down so about to make the jump. I'll be doing a lot of digging
on my own, but please link any resources that you feel were helpful for you.

~~~
fastbmk
[https://www.rust-lang.org/](https://www.rust-lang.org/)

------
clinta
Very happy to read about the improvements in releasing memory back to the OS.
Hopefully this will help prevent our go apps in containers from getting OOM
killed.

------
sandov
Something I consider off-putting about Go is that you need a Google account to
contribute.

[https://golang.org/doc/contribute.html](https://golang.org/doc/contribute.html)

> A contribution to Go is made through a Google account [...]. Google accounts
> can either be Gmail e-mail accounts, G Suite organization accounts, or
> accounts associated with an external e-mail address. [...]

Does anybody else feel the same way?

~~~
wmf
The fact that Go is mostly controlled by Google doesn't bother you, but that
does?

(I consciously avoided getting a Gmail account for years until I bought an
Android phone which requires such an account, so I understand where you're
coming from but this issue seems meh to me.)

~~~
tssva
> (I consciously avoided getting a Gmail account for years until I bought an
> Android phone which requires such an account, so I understand where you're
> coming from but this issue seems meh to me.)

Gmail accounts are not required for Android phones. To utilize the Google
services on an Android phone, which 99% of people will choose to do, a Google
account is required.

A Google account can be but doesn't have to be a Gmail account. You can use
any email address to create your Google account.

------
lsllc
Wow, AIX support! nice!

------
tjpnz
Is iOS a thing for Go?

~~~
rhodysurf
Sort of... it works with GoMobile but because it doesnt use LLVM there is no
support for bitcode which means WatchOS and tvOS are off limits and maybe iOS
someday.

~~~
steeleduncan
Would this be solveable with go-llvm?

