Tutorial by Examples

A simple program that writes "Hello, world!" to test.txt, reads back the data, and prints it out. Demonstrates simple file I/O operations. package main import ( "fmt" "io/ioutil" ) func main() { hello := []byte("Hello, world!") //...
package main import ( "fmt" "io/ioutil" ) func main() { files, err := ioutil.ReadDir(".") if err != nil { panic(err) } fmt.Println("Files and folders in the current directory:") for _, fileInfo := range fi...
package main import ( "fmt" "io/ioutil" ) func main() { files, err := ioutil.ReadDir(".") if err != nil { panic(err) } fmt.Println("Folders in the current directory:") for _, fileInfo := range files { ...

Page 1 of 1