Todo desenvolvedor em algum momento já se deparou com a necessidade de manipular e escrever arquivos, não é mesmo? Em Go, existem algumas maneiras bem simples de resolvermos essa necessidade de forma rápida. Para criar um novo arquivo e escrever algum conteúdo neste novo arquivo, podemos escrever o seguinte código. package main import ( "fmt" "os" ) func main() { //Creating a new file f, err := os.Create("test.txt") if err != nil { panic(err) } defer f.Close() //Writing to the new file. size, err := f.Write([]byte("Hello World!")) if err != nil { panic(err) } fmt.Printf("Size file: %d bytes", size) //If the content of your file is only text, you can opt for this other function. //size, err := f.WriteString("Hello World") } Agora que já criamos e escrevemos em um novo arquivo, podemos realizar a leitura deste arquivo com o seguinte código: package main import ( "fmt" "