Last active
June 9, 2018 07:38
-
-
Save perjerz/0a671fa0d710f1b795d3a8a52bf5681e to your computer and use it in GitHub Desktop.
UltimateGo
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import "fmt" | |
type user struct { | |
name string | |
email string | |
} | |
func main() { | |
u1 := createUser1() | |
fmt.Println(u1) | |
} | |
//go:noinline | |
func createUser1() *user { | |
u1 := user{ | |
name: "Hello", | |
email: "perjerz3434@gmail", | |
} | |
return &u1 | |
} | |
//composit ltereal | |
//// Share อยู่บน | |
//var u *user | |
//err := son.Unmarshal([]byte(r), u) | |
//return u, err | |
// | |
//// Share อยู่ล่าง Share กับ call | |
//var v user | |
//err2 := json.Unmarshal([]byte(r), &v) | |
//return v, err | |
//go build -gcflags "-m -m -m" -m -> ความลึก ตัวเดียวก็ได้ | |
// composit literal &x{ p: 1} | |
// go test -gcflags "-m -m" -run none -bench . -benchmem -memprofile mem.out | |
// go tool pprof -alloc_space mem.out | |
// https://github.com/ardanlabs/gotraining/tree/master/topics/go/profiling | |
// https://artem.krylysov.com/blog/ | |
// https://github.com/dvyukov |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment