gofix + rune fix
diff --git a/encode.go b/encode.go index 666258d..a06c4d0 100644 --- a/encode.go +++ b/encode.go
@@ -223,18 +223,18 @@ } func (e *encoder) intv(tag string, in reflect.Value) { - s := strconv.Itoa64(in.Int()) + s := strconv.FormatInt(in.Int(), 10) e.emitScalar(s, "", tag, C.YAML_PLAIN_SCALAR_STYLE) } func (e *encoder) uintv(tag string, in reflect.Value) { - s := strconv.Uitoa64(in.Uint()) + s := strconv.FormatUint(in.Uint(), 10) e.emitScalar(s, "", tag, C.YAML_PLAIN_SCALAR_STYLE) } func (e *encoder) floatv(tag string, in reflect.Value) { // FIXME: Handle 64 bits here. - s := strconv.Ftoa32(float32(in.Float()), 'g', -1) + s := strconv.FormatFloat(float64(in.Float()), 'g', -1, 32) switch s { case "+Inf": s = ".inf"
diff --git a/goyaml.go b/goyaml.go index 84dd1a7..77e50e6 100644 --- a/goyaml.go +++ b/goyaml.go
@@ -197,9 +197,9 @@ recommend := tag[:s] for _, c := range tag[s+1:] { switch c { - case int('c'): + case rune('c'): recommend += ",omitempty" - case int('f'): + case rune('f'): recommend += ",flow" default: msg := fmt.Sprintf("Unsupported flag %q in tag %q of type %s", string([]byte{uint8(c)}), tag, st)
diff --git a/resolve.go b/resolve.go index 577e1b9..dc053a2 100644 --- a/resolve.go +++ b/resolve.go
@@ -106,11 +106,11 @@ case '.': // Not in the map, so maybe a normal float. - floatv, err := strconv.Atof64(in) + floatv, err := strconv.ParseFloat(in, 64) if err == nil { return "!!float", floatv } - // XXX Handle base 60 floats here (WTF!) + // XXX Handle base 60 floats here (WTF!) case 'D', 'S': // Int, float, or timestamp. @@ -120,7 +120,7 @@ break } } - intv, err := strconv.Btoi64(in, 0) + intv, err := strconv.ParseInt(in, 0, 64) if err == nil { if intv == int64(int(intv)) { return "!!int", int(intv) @@ -128,22 +128,22 @@ return "!!int", intv } } - floatv, err := strconv.Atof64(in) + floatv, err := strconv.ParseFloat(in, 64) if err == nil { return "!!float", floatv } if strings.HasPrefix(in, "0b") { - intv, err := strconv.Btoi64(in[2:], 2) + intv, err := strconv.ParseInt(in[2:], 2, 64) if err == nil { return "!!int", int(intv) } } else if strings.HasPrefix(in, "-0b") { - intv, err := strconv.Btoi64(in[3:], 2) + intv, err := strconv.ParseInt(in[3:], 2, 64) if err == nil { return "!!int", -int(intv) } } - // XXX Handle timestamps here. + // XXX Handle timestamps here. case '<': // XXX Handle merge (<<) here.