Remove unnecessary json.Unmarshal wrapper.

Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: fb42e8477208badf0714a9d8ae20946a9b531dba
Component: engine
This commit is contained in:
Daniel Nephin
2016-08-04 12:17:37 -04:00
parent 1c5ac9c7e1
commit 2b0a71c4f1
8 changed files with 16 additions and 43 deletions

View File

@ -3,6 +3,7 @@ package main
import (
"bufio"
"bytes"
"encoding/json"
"fmt"
"io/ioutil"
"net"
@ -2397,7 +2398,7 @@ func (s *DockerSuite) TestRunAllowPortRangeThroughExpose(c *check.C) {
id := strings.TrimSpace(out)
portstr := inspectFieldJSON(c, id, "NetworkSettings.Ports")
var ports nat.PortMap
if err := unmarshalJSON([]byte(portstr), &ports); err != nil {
if err := json.Unmarshal([]byte(portstr), &ports); err != nil {
c.Fatal(err)
}
for port, binding := range ports {
@ -2827,7 +2828,7 @@ func (s *DockerSuite) TestRunAllowPortRangeThroughPublish(c *check.C) {
portstr := inspectFieldJSON(c, id, "NetworkSettings.Ports")
var ports nat.PortMap
err := unmarshalJSON([]byte(portstr), &ports)
err := json.Unmarshal([]byte(portstr), &ports)
c.Assert(err, checker.IsNil, check.Commentf("failed to unmarshal: %v", portstr))
for port, binding := range ports {
portnum, _ := strconv.Atoi(strings.Split(string(port), "/")[0])