Remove unnecessary json.Unmarshal wrapper.
Signed-off-by: Daniel Nephin <dnephin@docker.com> Upstream-commit: fb42e8477208badf0714a9d8ae20946a9b531dba Component: engine
This commit is contained in:
@ -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])
|
||||
|
||||
Reference in New Issue
Block a user