awesome-go/impl/files-manipulation/20-QuickReadWholeFile.go
2024-01-20 10:55:19 +02:00

21 lines
277 B
Go
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package main
import (
"os"
"log"
)
func main() {
/*
Dosyayı Hızlı Okuma (Quick Read Whole File to Memory)
*/
// Dosyadan byte dilimine okuma yapma
data, err := os.ReadFile("demo.txt")
if err != nil {
log.Fatal(err)
}
log.Printf("Data read: %s\n", data)
}