mirror of
https://github.com/teivah/100-go-mistakes.git
synced 2026-06-22 01:17:11 +08:00
29 lines
507 B
Go
29 lines
507 B
Go
package main
|
|
|
|
import "io"
|
|
|
|
func f(a int) (b int) {
|
|
b = a
|
|
return
|
|
}
|
|
|
|
type locator interface {
|
|
getCoordinates(address string) (float32, float32, error)
|
|
// getCoordinates(address string) (lat, lng float32, err error)
|
|
}
|
|
|
|
type loc struct{}
|
|
|
|
func (l loc) getCoordinates(address string) (lat, lng float32, err error) {
|
|
return 0, 0, nil
|
|
}
|
|
|
|
func ReadFull(r io.Reader, buf []byte) (n int, err error) {
|
|
for len(buf) > 0 && err == nil {
|
|
var nr int
|
|
nr, err = r.Read(buf)
|
|
n += nr
|
|
buf = buf[nr:]
|
|
}
|
|
return
|
|
}
|