httprouter is an open source Go package and can be installed using the go get command. Let us see the installation and basic usage in the steps given as follows:
- Install httprouter using this command:
go get github.com/julienschmidt/httprouter
We can import the library in our source code, like this:
import "github.com/julienschmidt/httprouter"
- The basic usage of httprouter can be understood through an example. Let us write a REST service in Go that provides two things:
- Gets the Go compiler version
- Gets the content of a given file
We need to use a system package called os/exec to fetch the preceding details.
- The os/exec package has a Command function, using which we can make any system call and the function signature ...