Manila, October 13, 2018
Engineering Manager, Freelancer.com
GoLang Developers Meetup Group
Ken Thompson
Rob Pike
Robert Griesemer
| Date | Go Version | |
|---|---|---|
| 2013/05/13 | 1.1 | Language + Other Changes |
| 2013/12/01 | 1.2 | Language + Other Changes |
| 2014/06/18 | 1.3 | No Language Changes |
| 2014/12/10 | 1.4 | Language + Other Changes |
| 2015/08/19 | 1.5 | Language + Other Changes |
| 2016/02/17 | 1.6 | No Language Changes |
| 2016/08/15 | 1.7 | Language + Other Changes |
| 2017/02/16 | 1.8 | Language + Other Changes |
| 2017/08/24 | 1.9 | Language + Other Changes |
| 2018/02/16 | 1.10 | No Language Changes |
$ mkdir -p /tmp/scratchpad/hello
$ cd /tmp/scratchpad/hello
$ go mod init github.com/JohnnyEstilles/hello
go: creating new go.mod: module github.com/JohnnyEstilles/hello
package main
import (
"fmt"
"rsc.io/quote"
)
func main() {
fmt.Println(quote.Hello())
}$ go build
$ ./hello
Hello, world.module github.com/JohnnyEstilles/hello
require rsc.io/quote v1.5.2package main
import "fmt"
func main() {
fmt.Println("Hello World!")
}$ GOOS=js GOARCH=wasm go build -o main.wasm
$ cp "$(go env GOROOT)/misc/wasm/wasm_exec.js" .<html>
<head>
<meta charset="utf-8">
<script src="wasm_exec.js"></script>
<script>
const go = new Go();
WebAssembly
.instantiateStreaming(fetch("main.wasm"), go.importObject)
.then((result) => {
go.run(result.instance);
});
</script>
</head>
<body></body>
</html>func CopyFile(src, dst string) error {
r, err := os.Open(src)
if err != nil {
return fmt.Errorf("copy %s %s: %v", src, dst, err)
}
defer r.Close()
w, err := os.Create(dst)
if err != nil {
return fmt.Errorf("copy %s %s: %v", src, dst, err)
}
if _, err := io.Copy(w, r); err != nil {
w.Close()
os.Remove(dst)
return fmt.Errorf("copy %s %s: %v", src, dst, err)
}
if err := w.Close(); err != nil {
os.Remove(dst)
return fmt.Errorf("copy %s %s: %v", src, dst, err)
}
}func CopyFile(src, dst string) error {
handle err {
return fmt.Errorf("copy %s %s: %v", src, dst, err)
}
r := check os.Open(src)
defer r.Close()
w := check os.Create(dst)
handle err {
w.Close()
os.Remove(dst) // (only if a check fails)
}
check io.Copy(w, r)
check w.Close()
return nil
}// A list implementation based on an internal slice.
type List(type T) []T
// A keys function which returns all keys of a map in a type-safe way.
func Keys(type K, V)(m map[K]V) []K {
...
}