DockerCLI/cli/command/inspect
Boaz Shuster 9a2f2d769d Unmarshal a number as a Number in RawInspectFallback
Running `docker inspect --format "{{.ID}} {{.Size}}" alpine` prints
sha256:651aa95985aa4a17a38ffcf71f598ec461924ca96865facc2c5782ef2d2be07f 3983636
While `docker inspect --format "{{.Id}} {{.Size}}" alpine` prints
sha256:651aa95985aa4a17a38ffcf71f598ec461924ca96865facc2c5782ef2d2be07f 3.983636e+06

This happens because "Id" is not a field of types.ImageInspect and thus
tryRawInspectFallback is called and converts the raw response into `interface{}`
using a JSON decoder. However, by default that decoder converts numbers into
`float64` unless `UseNumber` is set.

Signed-off-by: Boaz Shuster <ripcurld.github@gmail.com>
2017-06-21 13:10:14 +03:00
..
inspector.go Unmarshal a number as a Number in RawInspectFallback 2017-06-21 13:10:14 +03:00
inspector_test.go Unmarshal a number as a Number in RawInspectFallback 2017-06-21 13:10:14 +03:00