Advertisement
cwchen

[Go] struct demo

Sep 19th, 2017
632
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Go 0.17 KB | None | 0 0
  1. package main
  2.  
  3. import (
  4.     "fmt"
  5. )
  6.  
  7. type Point struct {
  8.     x float64
  9.     y float64
  10. }
  11.  
  12. func main() {
  13.     p := Point{x: 3.0, y: 4.0}
  14.  
  15.     fmt.Println(p.x)
  16.     fmt.Println(p.y)
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement