Created
January 13, 2023 19:08
-
-
Save ssebastianoo/d74e1b83db0c9799b4619d9296721f74 to your computer and use it in GitHub Desktop.
the no hello simulator
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" | |
| "log" | |
| "os" | |
| "path/filepath" | |
| "strconv" | |
| "time" | |
| ) | |
| func main() { | |
| homeDir, _ := os.UserHomeDir() | |
| for i := 1; true; i++ { | |
| file, err := os.Create(filepath.Join(homeDir, "desktop", fmt.Sprintf("ciao%s.txt", strconv.Itoa(i)))) | |
| if err != nil { | |
| log.Fatal(err) | |
| } | |
| defer file.Close() | |
| file.WriteString("ciao") | |
| fmt.Println("ciao") | |
| time.Sleep(1 * time.Second) | |
| } | |
| } |
ciao
Author
ciao
ciao
ciao
Author
ciao
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
ciao