Skip to content

Instantly share code, notes, and snippets.

@yakuter
Created April 4, 2021 13:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yakuter/ce89ad4f5a0ec3080f1884bafc6baeba to your computer and use it in GitHub Desktop.
Save yakuter/ce89ad4f5a0ec3080f1884bafc6baeba to your computer and use it in GitHub Desktop.
Go parametreleri dosyaya yazan uygulama
package main
import (
"log"
"os"
)
func main() {
file, err := os.OpenFile("geekday.txt", os.O_CREATE|os.O_APPEND|os.O_RDWR, 0644)
if err != nil {
log.Fatal(err)
}
defer file.Close()
args := os.Args[1:]
for i := range args {
file.WriteString(args[i] + "\n")
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment