Created
November 20, 2021 13:33
-
-
Save zgunz42/1197ab5497e8efdda84e2e2901da3099 to your computer and use it in GitHub Desktop.
This file contains hidden or 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" | |
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