...

/

Developing the which(1) Utility in Go

Developing the which(1) Utility in Go

Let’s learn how to create the Go version of the which(1) utility to locate a program file in the user's PATH value.

Let’s now discuss a practical example for developing a Go version of the which(1) utility, which locates a program file in the user's PATH value.

Go can work with our operating system through a set of packages. A good way to learn a new programming language is by trying to implement simple versions of traditional UNIX utilities. In this lesson, we’ll see a Go version of the which(1) utility, which will help us understand the way Go interacts with the underlying OS and reads environment variables. ...