Fix indention

This commit is contained in:
Mike Raunsbæk 2018-06-15 08:57:10 +02:00
parent f77fb4fbc0
commit b6acdacddd
3 changed files with 30 additions and 33 deletions

View File

@ -60,7 +60,6 @@ func ipFromRequest(header string, r *http.Request) (net.IP, error) {
if ip != nil {
remoteIP = ip.String()
}
fmt.Printf("IP: %v\n", ip)
}
if remoteIP == "" {
host, _, err := net.SplitHostPort(r.RemoteAddr)
@ -68,7 +67,6 @@ func ipFromRequest(header string, r *http.Request) (net.IP, error) {
}
remoteIP = host
}
fmt.Printf("Remote: %v\n", remoteIP)
ip := net.ParseIP(remoteIP)
if ip == nil {
return nil, fmt.Errorf("could not parse IP: %s", remoteIP)
@ -90,7 +88,7 @@ func (s *Server) newResponse(r *http.Request) (Response, error) {
hostname, _ = s.LookupAddr(ip)
}
var autonomousSystemNumber string
if(asn.AutonomousSystemNumber > 0) {
if asn.AutonomousSystemNumber > 0 {
autonomousSystemNumber = "AS" + strconv.FormatUint(uint64(asn.AutonomousSystemNumber), 10);
}
return Response{
@ -280,7 +278,6 @@ func (s *Server) Handler() http.Handler {
// JSON
r.Route("GET", "/", s.JSONHandler).Header("Accept", jsonMediaType)
r.Route("GET", "/json", s.JSONHandler)
r.RoutePrefix("GET", "/json/", s.JSONHandler)
// CLI