Skip to content

Latest commit

 

History

History
33 lines (22 loc) · 785 Bytes

lesson3.md

File metadata and controls

33 lines (22 loc) · 785 Bytes

Lesson 3: Command Line Applications

In this lesson, we will implement several common unix commands in Go.

  • The commands
    • cat - copy input to standard output | 15 minutes
    • head - ouput the first part of files | 15 minutes
    • tail - ouput the last part of files | 15 minutes
    • tac - copy input to standard output in reverse | 15 minutes

cat - copy input to standard output

  • go get lesson3/go-cat-01

  • go test lesson3/go-cat-01

  • reading from standard input

  • reading from a file

  • writing to standard output

  • io package

    • io.Reader
    • io.Writer
  • The os package

    • io.Reader
    • io.Writer

head - ouput the first part of files

tail - ouput the last part of files

tac - copy input to standard output in reverse