This project implements the "Head" challenge from Coding Challenges, a task that focuses on creating a program to display the first N lines of a given text file. Written in Go, this project offers a lightweight and efficient solution for file reading and data processing.
To install this project, ensure you have Go installed on your system. You can download it from Go's official website.
- Clone the repository:
git clone https://github.com/afonsocraposo/go-head
- Navigate to the project directory:
cd go-head
To use the program, run the following command in your terminal:
go run head.go [file name] ...
Usage of head.go
:
Usage of head.go:
-c int
display first c bytes
-n int
display first n lines (default 10)
go run head.go -n 10 test.txt
go run head.go -c 10 test.txt
go run head.go -n 10 test.txt test2.txt
This project is licensed under the MIT License - see the LICENSE file for details.