Skip to content

Instantly share code, notes, and snippets.

@zgunz42
Created November 20, 2021 13:33
Show Gist options
  • Save zgunz42/1197ab5497e8efdda84e2e2901da3099 to your computer and use it in GitHub Desktop.
Save zgunz42/1197ab5497e8efdda84e2e2901da3099 to your computer and use it in GitHub Desktop.
package main
import "fmt"
type Timer struct {
id string
value int
}
func (t *Timer) tick() {
t.value +=1
fmt.Println(t.value)
}
func main() {
var x int
fmt.Scanln(&x)
t := Timer{"timer1", 0}
for i:=0;i<x;i++ {
t.tick()
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment