如何更高效/更紧凑地编写此(详细的)Golang代码?

How can I write this block more compact? I think it's a lot of lines of code to write something so simple.

// GetSegments Retrieve segments near given coordinate.
func GetSegments(w http.ResponseWriter, r *http.Request) {
  near := r.FormValue("near")
  givenCoordinate := strings.Split(near, ",")

  lat, _ := strconv.ParseFloat(givenCoordinate[0], 32)
  lon, _ := strconv.ParseFloat(givenCoordinate[1], 32)

  lat32 := float32(lat)
  lon32 := float32(lon)

  coord := Coordinate{
      Latitude:  lat32,
      Longitude: lon32}

  fmt.Println(coord)
}

This block of code is called via a web API: http://localhost:8080/segments?near=14.52872,52.21244

I really like Go, but this is one of the things where I'm wondering if I'm using it right..

The most important thing is that you write code that produces correct results with useful error messages. Check for errors. For example,

type Coordinate struct {
    Latitude  float32
    Longitude float32
}

// GetSegments Retrieve segments near given coordinate.
// http://localhost:8080/segments?near=14.52872,52.21244
func GetSegments(w http.ResponseWriter, r *http.Request) (Coordinate, error) {
    const fnc = "GetSegments"
    near := r.FormValue("near")
    if len(near) == 0 {
        return Coordinate{}, fmt.Errorf("%s: near coordinates missing", fnc)
    }
    latlon := strings.Split(near, ",")
    if len(latlon) != 2 {
        return Coordinate{}, fmt.Errorf("%s: near coordinates error: %s", fnc, near)
    }
    lat, err := strconv.ParseFloat(latlon[0], 32)
    if err != nil {
        return Coordinate{}, fmt.Errorf("%s: near latitude: %s: %s", fnc, latlon[0], err)
    }
    lon, err := strconv.ParseFloat(latlon[1], 32)
    if err != nil {
        return Coordinate{}, fmt.Errorf("%s: near longitude: %s: %s", fnc, latlon[1], err)
    }
    coord := Coordinate{
        Latitude:  float32(lat),
        Longitude: float32(lon),
    }
    fmt.Println(coord)
    return coord, nil
}