Gopher Fest 2017
参加レポート
2017/06/01(木)
golang.tokyo#6
The Go gopher was designed by Renee French.
The gopher stickers was made by Takuya Ueda.
Licensed under the Creative Commons 3.0
Attributions license.
math/bits
■ ビット演算に便利なライブラリ
● #18616にて提案
● http://tip.golang.org/pkg/math/bits/
● LenXX, OnesCountXX
● ReverseXX, ReverseBytesXX
● RotateLeftXX
● LeadingZerosXX, TrailingZerosXX
21
fmt.Printf("%d (%b) has %d bits set to onen", n, n, bits.OnesCount(n))
fmt.Printf("%d reversed is %dn", n, bits.Reverse(n))
fmt.Printf("%d can be encoded in %d bitsn", n, bits.Len(n))
コンパイラのエラーメッセージの改善
29
package main
func main()
{
fmt.Println("thatain't gonna compile")
}
fail/main.go:4: syntax error: unexpected semicolon or newline before {
fail/main.go:3:6: missing function body for "main"
fail/main.go:4:1: syntax error: unexpected semicolon or newline before {
Go1.8
Go1.9
go testの改善
■ 複数パッケージの場合にvendorを無視
●https://golang.org/issue/19090
31
$ go test ./...
■ テスト関数一覧が出せるように
● https://golang.org/issue/17209
$ go test -test.list .
TestIntegration
TestEmbedStreams
TestEmbedFiles
32.
go doc
■ フィールドにリンクが貼れるようになった
●https://golang.org/issue/16753
● https://tip.golang.org/pkg/net/http/#Client.
Transport
32