Guest User

Untitled

a guest
Jan 15th, 2018
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Go 0.19 KB | None | 0 0
  1. type Foo struct {
  2.     img image.Image
  3. }
  4.  
  5. func main() {
  6.     var f Foo
  7.     if f.img { // f.img has been set before
  8.         img := f.img
  9.     } else {
  10.         img := SomeImage()
  11.         f.img = img
  12.     }
  13.  
  14.     DoStuff(img)
  15. }
Add Comment
Please, Sign In to add comment