Trying to build a statically linked version of a go program that runs an http server, and uses the net package to determine and parse the IP address of the incoming request. With this build statement:
CGO_ENABLED=0 go install -a -ldflags '-s' .
And this preamble in my program:
package main
import (
"encoding/json"
"errors"
"fmt"
"log"
"net"
"net/http"
"path/filepath"
"strings"
"golang.org/x/blog/content/context/userip"
"github.com/oschwald/maxminddb-golang"
)
This worked building with go 1.3, producing a statically linked program, but is not working with go 1.4.2. The build succeeds, but the program is not statically linked.
Does anyone know what is going on?