Created
December 10, 2020 05:13
-
-
Save podhmo/484764897c79e1900928b0f4f9f1327e to your computer and use it in GitHub Desktop.
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
module m | |
go 1.15 |
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 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) | |
} | |
} |
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
run: | |
go run main.go | |
asm: | |
go tool compile -S -N main.go | |
asm2: | |
go build -gcflags="-S -N" main.go |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment