Merge lp:~rogpeppe/goyaml/goyaml-rune-changes into lp:~gophers/goyaml/trunk
Proposed by
Roger Peppe
Status: | Merged |
---|---|
Merged at revision: | 31 |
Proposed branch: | lp:~rogpeppe/goyaml/goyaml-rune-changes |
Merge into: | lp:~gophers/goyaml/trunk |
Diff against target: | 0 lines |
To merge this branch: | bzr merge lp:~rogpeppe/goyaml/goyaml-rune-changes |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
The Go Language Gophers | Pending | ||
Review via email: mp+85889@code.launchpad.net |
Description of the change
To post a comment you must log in.
Reviewers: mp+85889_ code.launchpad. net,
Message:
Please take a look.
Description:
gofix + rune conversion.
https:/ /code.launchpad .net/~rogpeppe/ goyaml/ goyaml- rune-changes/ +merge/ 85889
(do not edit description out of merge proposal)
Please review this at https:/ /codereview. appspot. com/5496045/
Affected files:
M encode.go
M goyaml.go
M resolve.go
Index: encode.go
=== <email address hidden> >
<email address hidden>
=== modified file 'encode.go'
--- encode.go 2011-11-24 19:47:20 +0000
+++ encode.go 2011-12-15 15:22:49 +0000
@@ -223,18 +223,18 @@
}
func (e *encoder) intv(tag string, in reflect.Value) { Itoa64( in.Int( )) FormatInt( in.Int( ), 10) PLAIN_SCALAR_ STYLE)
- s := strconv.
+ s := strconv.
e.emitScalar(s, "", tag, C.YAML_
}
func (e *encoder) uintv(tag string, in reflect.Value) { Uitoa64( in.Uint( )) FormatUint( in.Uint( ), 10) PLAIN_SCALAR_ STYLE)
- s := strconv.
+ s := strconv.
e.emitScalar(s, "", tag, C.YAML_
}
func (e *encoder) floatv(tag string, in reflect.Value) { Ftoa32( float32( in.Float( )), 'g', -1) FormatFloat( float64( in.Float( )), 'g', -1, 32)
// FIXME: Handle 64 bits here.
- s := strconv.
+ s := strconv.
switch s {
case "+Inf":
s = ".inf"
Index: goyaml.go "Unsupported flag %q in tag %q of type %s", []byte{ uint8(c) }), tag, st)
=== <email address hidden> >
<email address hidden>
=== modified file 'goyaml.go'
--- goyaml.go 2011-11-24 19:50:00 +0000
+++ goyaml.go 2011-12-15 15:22:49 +0000
@@ -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(
string(
Index: resolve.go
=== <email address hidden> >
<email address hidden>
=== modified file 'resolve.go'
--- resolve.go 2011-11-24 19:47:20 +0000
+++ resolve.go 2011-12-15 15:22:49 +0000
@@ -106,11 +106,11 @@
case '.': ParseFloat( in, 64)
// Not in the map, so maybe a normal float.
- floatv, err := strconv.Atof64(in)
+ floatv, err := strconv.
if err == nil {
return "!!float", floatv
}
- // XXX Handle base 60 floats here (WTF!)
+ // XXX Handle base 60 floats here (WTF!)
case 'D', 'S': ParseInt( in, 0, 64) ParseFloat( in, 64) HasPrefix( in, "0b") { Btoi64( in[2:], 2) ParseInt( in[2:], 2, 64) HasPrefix( in, "-0b") { Btoi64( in[3:], 2)
// Int, float, or timestamp.
@@ -120,7 +120,7 @@
break
}
}
- intv, err := strconv.Btoi64(in, 0)
+ intv, err := strconv.
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.
if err == nil {
return "!!float", floatv
}
if strings.
- intv, err := strconv.
+ intv, err := strconv.
if err == nil {
return "!!int", int(intv)
}
} else if strings.
- intv, err := strconv.
...