Explorar el Código

codec: work around https://github.com/golang/go/issues/12927

go 1.4 was throwing an error saying
    v declared and not used

We workaround it by referencing v directly within the function,
not just as a function argument.

We will keep this in till go 1.6 is released.

Fixes #108
Ugorji Nwoke hace 10 años
padre
commit
8a2a3a8c48
Se han modificado 2 ficheros con 2 adiciones y 0 borrados
  1. 1 0
      codec/fast-path.generated.go
  2. 1 0
      codec/fast-path.go.tmpl

+ 1 - 0
codec/fast-path.generated.go

@@ -3104,6 +3104,7 @@ func fastpathEncodeTypeSwitchMap(iv interface{}, e *Encoder) bool {
 		fastpathTV.EncMapBoolBoolV(*v, fastpathCheckNilTrue, e)
 
 	default:
+		_ = v // TODO: workaround https://github.com/golang/go/issues/12927 (remove after go 1.6 release)
 		return false
 	}
 	return true

+ 1 - 0
codec/fast-path.go.tmpl

@@ -116,6 +116,7 @@ func fastpathEncodeTypeSwitch(iv interface{}, e *Encoder) bool {
 		fastpathTV.{{ .MethodNamePfx "Enc" false }}V(*v, fastpathCheckNilTrue, e)
 {{end}}{{end}}
 	default:
+		_ = v // TODO: workaround https://github.com/golang/go/issues/12927 (remove after go 1.6 release)
 		return false
 	}
 	return true