Skip to content

Instantly share code, notes, and snippets.

@podhmo
Created December 10, 2020 05:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save podhmo/484764897c79e1900928b0f4f9f1327e to your computer and use it in GitHub Desktop.
Save podhmo/484764897c79e1900928b0f4f9f1327e to your computer and use it in GitHub Desktop.
module m
go 1.15
package m
import "fmt"
type Getter interface {
Get(key string) string
}
func PrintIfGet(g Getter, k string) {
v := g.Get(k)
if v != "" {
fmt.Println("yay", k, v)
}
}
run:
go run main.go
asm:
go tool compile -S -N main.go
asm2:
go build -gcflags="-S -N" main.go
This file has been truncated, but you can view the full file.
View raw

(Sorry about that, but we can’t show files that are this big right now.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment