This repository contains an example of how to read file (txt and JSON file type) in Go.
- Go 1.20+
To clone the application to your local:
git clone <this_repositoy_web_url>
To run the application:
cd simple-read-file
go run main.go
The main.go
will read files inside data/
folder.
You will see below as the return:
Txt file: Hey, world! good morning!
Print products with field name: [{ID:93938317 Name:Nike Running Shoes CreatedAt:11000909090} {ID:93938260 Name:White Midi Dress CreatedAt:11000909091}]
First product: {93938317 Nike Running Shoes 11000909090}
- Official website: https://go.dev
- Learn: https://go.dev/learn/
- The Go Playground: https://go.dev/play/