Make compatible with go version 1. Also formatted with gofmt