Skip to content

Commit

Permalink
Import canonical/json as canonicaljson
Browse files Browse the repository at this point in the history
To avoid confusing it with encoding/json.

Signed-off-by: Ashwini Oruganti <[email protected]>
  • Loading branch information
ashfall committed May 8, 2017
1 parent cd22029 commit 1f4822b
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions cmd/notary/tuf.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import (
"github.com/docker/distribution/registry/client/auth/challenge"
"github.com/docker/distribution/registry/client/transport"
"github.com/docker/go-connections/tlsconfig"
"github.com/docker/go/canonical/json"
canonicaljson "github.com/docker/go/canonical/json"
"github.com/docker/notary"
notaryclient "github.com/docker/notary/client"
"github.com/docker/notary/cryptoservice"
Expand Down Expand Up @@ -254,8 +254,8 @@ func getTargetHashes(t *tufCommander) (data.Hashes, error) {
}

// Open and read a file containing the targetCustom data
func getTargetCustom(targetCustomFilename string) (*json.RawMessage, error) {
targetCustom := new(json.RawMessage)
func getTargetCustom(targetCustomFilename string) (*canonicaljson.RawMessage, error) {
targetCustom := new(canonicaljson.RawMessage)
rawTargetCustom, err := ioutil.ReadFile(targetCustomFilename)
if err != nil {
return nil, err
Expand All @@ -280,7 +280,7 @@ func (t *tufCommander) tufAddByHash(cmd *cobra.Command, args []string) error {
gun := data.GUN(args[0])
targetName := args[1]
targetSize := args[2]
var targetCustom *json.RawMessage
var targetCustom *canonicaljson.RawMessage
if t.custom != "" {
targetCustom, err = getTargetCustom(t.custom)
if err != nil {
Expand Down Expand Up @@ -346,7 +346,7 @@ func (t *tufCommander) tufAdd(cmd *cobra.Command, args []string) error {
gun := data.GUN(args[0])
targetName := args[1]
targetPath := args[2]
var targetCustom *json.RawMessage
var targetCustom *canonicaljson.RawMessage
if t.custom != "" {
targetCustom, err = getTargetCustom(t.custom)
if err != nil {
Expand Down

0 comments on commit 1f4822b

Please sign in to comment.