Created
April 4, 2021 13:21
-
-
Save yakuter/ce89ad4f5a0ec3080f1884bafc6baeba to your computer and use it in GitHub Desktop.
Go parametreleri dosyaya yazan uygulama
This file contains 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 ( | |
"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