Building Thing

Once Creating a Thing, build and install the Thing

Building Thing

Continuing in the working directory from the previous step, compile, link, and install Thing with the go install command:

$ cd merle/thing

$ go install ./...

The resulting binary file will have the same name as the working directory and can be found in the ~/go/bin directory:

$ ls -l ~/go/bin/thing

-rwxr-xr-x 1 merle merle 10380056 Jul 29 19:14 /home/merle/go/bin/thing

Setting Permissions

If the Thing runs as a web server serving HTTP or HTTP and HTTPS traffic, and uses ports below 1024 (default for HTTP is port 80 and HTTPS is 443), then we need to change the permissions so Thing can listen on those ports.

$ sudo setcap CAP_NET_BIND_SERVICE=+eip ~/go/bin/thing

Each time Thing is built, this command must be run to update the permissions.

Continue to Running Thing