Created
July 6, 2016 17:47
-
-
Save bahaddinyasar/d4f3a70d84a6a5e12165dc54e1272d37 to your computer and use it in GitHub Desktop.
string formatting in golang
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" | |
import "os" | |
type point struct { | |
x, y int | |
} | |
func main() { | |
p := point{1, 2} | |
fmt.Printf("%v\n", p) | |
fmt.Printf("%+v\n", p) | |
} | |
// $ go run string-formatting.go | |
// {1 2} | |
// {x:1 y:2} | |
// ref: https://gobyexample.com/string-formatting |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment