Skip to content

Instantly share code, notes, and snippets.

@bahaddinyasar
Created July 6, 2016 17:47
Show Gist options
  • Save bahaddinyasar/d4f3a70d84a6a5e12165dc54e1272d37 to your computer and use it in GitHub Desktop.
Save bahaddinyasar/d4f3a70d84a6a5e12165dc54e1272d37 to your computer and use it in GitHub Desktop.
string formatting in golang
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