diff --git a/cmd/noms-diff/noms_diff.go b/cmd/noms-diff/noms_diff.go index 7ee9bda478..46a2862692 100644 --- a/cmd/noms-diff/noms_diff.go +++ b/cmd/noms-diff/noms_diff.go @@ -12,9 +12,9 @@ import ( "os" "github.com/attic-labs/noms/cmd/noms-diff/diff" + "github.com/attic-labs/noms/go/d" "github.com/attic-labs/noms/go/spec" "github.com/attic-labs/noms/go/util/outputpager" - "github.com/attic-labs/noms/samples/go/util" ) const ( @@ -41,20 +41,20 @@ func main() { } if len(flag.Args()) != 2 { - util.CheckErrorNoUsage(errors.New("Expected exactly two arguments")) + d.CheckErrorNoUsage(errors.New("Expected exactly two arguments")) } db1, value1, err := spec.GetPath(flag.Arg(0)) - util.CheckErrorNoUsage(err) + d.CheckErrorNoUsage(err) if value1 == nil { - util.CheckErrorNoUsage(fmt.Errorf("Object not found: %s", flag.Arg(0))) + d.CheckErrorNoUsage(fmt.Errorf("Object not found: %s", flag.Arg(0))) } defer db1.Close() db2, value2, err := spec.GetPath(flag.Arg(1)) - util.CheckErrorNoUsage(err) + d.CheckErrorNoUsage(err) if value2 == nil { - util.CheckErrorNoUsage(fmt.Errorf("Object not found: %s", flag.Arg(1))) + d.CheckErrorNoUsage(fmt.Errorf("Object not found: %s", flag.Arg(1))) } defer db2.Close() diff --git a/cmd/noms-ds/noms_ds.go b/cmd/noms-ds/noms_ds.go index 5ff5aa9cd7..a062947234 100644 --- a/cmd/noms-ds/noms_ds.go +++ b/cmd/noms-ds/noms_ds.go @@ -9,9 +9,9 @@ import ( "fmt" "os" + "github.com/attic-labs/noms/go/d" "github.com/attic-labs/noms/go/spec" "github.com/attic-labs/noms/go/types" - "github.com/attic-labs/noms/samples/go/util" ) func main() { @@ -28,15 +28,15 @@ func main() { if *toDelete != "" { set, err := spec.GetDataset(*toDelete) - util.CheckError(err) + d.CheckError(err) oldCommitRef, errBool := set.MaybeHeadRef() if !errBool { - util.CheckError(fmt.Errorf("Dataset %v not found", set.ID())) + d.CheckError(fmt.Errorf("Dataset %v not found", set.ID())) } store, err := set.Database().Delete(set.ID()) - util.CheckError(err) + d.CheckError(err) defer store.Close() fmt.Printf("Deleted dataset %v (was %v)\n\n", set.ID(), oldCommitRef.TargetHash().String()) @@ -47,7 +47,7 @@ func main() { } store, err := spec.GetDatabase(flag.Arg(0)) - util.CheckError(err) + d.CheckError(err) defer store.Close() store.Datasets().IterAll(func(k, v types.Value) { diff --git a/cmd/noms-log/noms_log.go b/cmd/noms-log/noms_log.go index 6450b84ba1..74a80a6260 100644 --- a/cmd/noms-log/noms_log.go +++ b/cmd/noms-log/noms_log.go @@ -22,7 +22,6 @@ import ( "github.com/attic-labs/noms/go/types" "github.com/attic-labs/noms/go/util/orderedparallel" "github.com/attic-labs/noms/go/util/outputpager" - "github.com/attic-labs/noms/samples/go/util" "github.com/mgutz/ansi" ) @@ -57,26 +56,26 @@ func main() { } if len(flag.Args()) != 1 { - util.CheckError(errors.New("expected exactly one argument")) + d.CheckError(errors.New("expected exactly one argument")) } useColor = shouldUseColor() database, value, err := spec.GetPath(flag.Arg(0)) if err != nil { - util.CheckErrorNoUsage(err) + d.CheckErrorNoUsage(err) } defer database.Close() if value == nil { - util.CheckErrorNoUsage(fmt.Errorf("Object not found: %s", flag.Arg(0))) + d.CheckErrorNoUsage(fmt.Errorf("Object not found: %s", flag.Arg(0))) } waitChan := outputpager.PageOutput(!*outputpager.NoPager) origCommit, ok := value.(types.Struct) if !ok || !origCommit.Type().Equals(datas.CommitType()) { - util.CheckError(fmt.Errorf("%s does not reference a Commit object", flag.Arg(0))) + d.CheckError(fmt.Errorf("%s does not reference a Commit object", flag.Arg(0))) } iter := NewCommitIterator(database, origCommit) diff --git a/cmd/noms-log/noms_log_test.go b/cmd/noms-log/noms_log_test.go index 79ecdede50..fbb0f649fc 100644 --- a/cmd/noms-log/noms_log_test.go +++ b/cmd/noms-log/noms_log_test.go @@ -8,11 +8,11 @@ import ( "fmt" "testing" + "github.com/attic-labs/noms/go/d" "github.com/attic-labs/noms/go/dataset" "github.com/attic-labs/noms/go/spec" "github.com/attic-labs/noms/go/types" "github.com/attic-labs/noms/samples/go/test_util" - "github.com/attic-labs/noms/samples/go/util" "github.com/attic-labs/testify/assert" "github.com/attic-labs/testify/suite" ) @@ -31,7 +31,7 @@ func (testExiter) Exit(code int) { } func TestNomsShow(t *testing.T) { - util.UtilExiter = testExiter{} + d.UtilExiter = testExiter{} suite.Run(t, &nomsShowTestSuite{}) } diff --git a/cmd/noms-serve/noms_serve.go b/cmd/noms-serve/noms_serve.go index 60469214e6..b637232b83 100644 --- a/cmd/noms-serve/noms_serve.go +++ b/cmd/noms-serve/noms_serve.go @@ -15,7 +15,6 @@ import ( "github.com/attic-labs/noms/go/datas" "github.com/attic-labs/noms/go/spec" "github.com/attic-labs/noms/go/util/profile" - "github.com/attic-labs/noms/samples/go/util" ) var ( @@ -39,7 +38,7 @@ func main() { } cs, err := spec.GetChunkStore(flag.Arg(0)) - util.CheckError(err) + d.CheckError(err) server := datas.NewRemoteDatabaseServer(cs, *port) // Shutdown server gracefully so that profile may be written diff --git a/cmd/noms-show/noms_show.go b/cmd/noms-show/noms_show.go index 3575823da6..e2cb44fefa 100644 --- a/cmd/noms-show/noms_show.go +++ b/cmd/noms-show/noms_show.go @@ -11,10 +11,10 @@ import ( "fmt" "os" + "github.com/attic-labs/noms/go/d" "github.com/attic-labs/noms/go/spec" "github.com/attic-labs/noms/go/types" "github.com/attic-labs/noms/go/util/outputpager" - "github.com/attic-labs/noms/samples/go/util" ) var ( @@ -36,11 +36,11 @@ func main() { } if len(flag.Args()) != 1 { - util.CheckErrorNoUsage(errors.New("expected exactly one argument")) + d.CheckErrorNoUsage(errors.New("expected exactly one argument")) } database, value, err := spec.GetPath(flag.Arg(0)) - util.CheckErrorNoUsage(err) + d.CheckErrorNoUsage(err) if value == nil { fmt.Fprintf(os.Stderr, "Object not found: %s\n", flag.Arg(0)) diff --git a/cmd/noms-sync/noms_sync.go b/cmd/noms-sync/noms_sync.go index c1cbe2c676..eca806109b 100644 --- a/cmd/noms-sync/noms_sync.go +++ b/cmd/noms-sync/noms_sync.go @@ -16,7 +16,6 @@ import ( "github.com/attic-labs/noms/go/spec" "github.com/attic-labs/noms/go/types" "github.com/attic-labs/noms/go/util/profile" - "github.com/attic-labs/noms/samples/go/util" ) var ( @@ -38,15 +37,15 @@ func main() { flag.Parse() if flag.NArg() != 2 { - util.CheckError(errors.New("expected a source object and destination dataset")) + d.CheckError(errors.New("expected a source object and destination dataset")) } sourceStore, sourceObj, err := spec.GetPath(flag.Arg(0)) - util.CheckError(err) + d.CheckError(err) defer sourceStore.Close() sinkDataset, err := spec.GetDataset(flag.Arg(1)) - util.CheckError(err) + d.CheckError(err) defer sinkDataset.Database().Close() err = d.Try(func() { diff --git a/samples/go/util/check_error.go b/go/d/check_error.go similarity index 97% rename from samples/go/util/check_error.go rename to go/d/check_error.go index 13c4a1a716..86189ce911 100644 --- a/samples/go/util/check_error.go +++ b/go/d/check_error.go @@ -2,7 +2,7 @@ // Licensed under the Apache License, version 2.0: // http://www.apache.org/licenses/LICENSE-2.0 -package util +package d import ( "flag" diff --git a/samples/go/codec-perf-rig/.gitignore b/go/perf/codec-perf-rig/.gitignore similarity index 100% rename from samples/go/codec-perf-rig/.gitignore rename to go/perf/codec-perf-rig/.gitignore diff --git a/samples/go/codec-perf-rig/main.go b/go/perf/codec-perf-rig/main.go similarity index 100% rename from samples/go/codec-perf-rig/main.go rename to go/perf/codec-perf-rig/main.go diff --git a/samples/go/encode-perf-rig/.gitignore b/go/perf/encode-perf-rig/.gitignore similarity index 100% rename from samples/go/encode-perf-rig/.gitignore rename to go/perf/encode-perf-rig/.gitignore diff --git a/samples/go/encode-perf-rig/README.md b/go/perf/encode-perf-rig/README.md similarity index 100% rename from samples/go/encode-perf-rig/README.md rename to go/perf/encode-perf-rig/README.md diff --git a/samples/go/encode-perf-rig/binary-encoder.go b/go/perf/encode-perf-rig/binary-encoder.go similarity index 100% rename from samples/go/encode-perf-rig/binary-encoder.go rename to go/perf/encode-perf-rig/binary-encoder.go diff --git a/samples/go/encode-perf-rig/binary-int-encoder.go b/go/perf/encode-perf-rig/binary-int-encoder.go similarity index 100% rename from samples/go/encode-perf-rig/binary-int-encoder.go rename to go/perf/encode-perf-rig/binary-int-encoder.go diff --git a/samples/go/encode-perf-rig/binary-varint-encoder.go b/go/perf/encode-perf-rig/binary-varint-encoder.go similarity index 100% rename from samples/go/encode-perf-rig/binary-varint-encoder.go rename to go/perf/encode-perf-rig/binary-varint-encoder.go diff --git a/samples/go/encode-perf-rig/encoder-type.go b/go/perf/encode-perf-rig/encoder-type.go similarity index 100% rename from samples/go/encode-perf-rig/encoder-type.go rename to go/perf/encode-perf-rig/encoder-type.go diff --git a/samples/go/encode-perf-rig/main.go b/go/perf/encode-perf-rig/main.go similarity index 100% rename from samples/go/encode-perf-rig/main.go rename to go/perf/encode-perf-rig/main.go diff --git a/samples/go/encode-perf-rig/run.sh b/go/perf/encode-perf-rig/run.sh similarity index 100% rename from samples/go/encode-perf-rig/run.sh rename to go/perf/encode-perf-rig/run.sh diff --git a/samples/go/encode-perf-rig/string-encoder.go b/go/perf/encode-perf-rig/string-encoder.go similarity index 100% rename from samples/go/encode-perf-rig/string-encoder.go rename to go/perf/encode-perf-rig/string-encoder.go diff --git a/samples/go/hash-perf-rig/README.md b/go/perf/hash-perf-rig/README.md similarity index 100% rename from samples/go/hash-perf-rig/README.md rename to go/perf/hash-perf-rig/README.md diff --git a/samples/go/hash-perf-rig/main.go b/go/perf/hash-perf-rig/main.go similarity index 100% rename from samples/go/hash-perf-rig/main.go rename to go/perf/hash-perf-rig/main.go diff --git a/samples/go/util/util.go b/go/util/jsontonoms/json_to_noms.go similarity index 98% rename from samples/go/util/util.go rename to go/util/jsontonoms/json_to_noms.go index fb3c4d77aa..a4da2f5985 100644 --- a/samples/go/util/util.go +++ b/go/util/jsontonoms/json_to_noms.go @@ -2,7 +2,7 @@ // Licensed under the Apache License, version 2.0: // http://www.apache.org/licenses/LICENSE-2.0 -package util +package jsontonoms import ( "reflect" diff --git a/samples/go/test_util/util_test.go b/go/util/jsontonoms/json_to_noms_test.go similarity index 70% rename from samples/go/test_util/util_test.go rename to go/util/jsontonoms/json_to_noms_test.go index 795065ff1c..9d54af0a01 100644 --- a/samples/go/test_util/util_test.go +++ b/go/util/jsontonoms/json_to_noms_test.go @@ -2,13 +2,12 @@ // Licensed under the Apache License, version 2.0: // http://www.apache.org/licenses/LICENSE-2.0 -package test_util +package jsontonoms import ( "testing" "github.com/attic-labs/noms/go/types" - "github.com/attic-labs/noms/samples/go/util" "github.com/attic-labs/testify/suite" ) @@ -21,23 +20,23 @@ type LibTestSuite struct { } func (suite *LibTestSuite) TestPrimitiveTypes() { - suite.EqualValues(types.String("expected"), util.NomsValueFromDecodedJSON("expected", false)) - suite.EqualValues(types.Bool(false), util.NomsValueFromDecodedJSON(false, false)) - suite.EqualValues(types.Number(1.7), util.NomsValueFromDecodedJSON(1.7, false)) - suite.False(util.NomsValueFromDecodedJSON(1.7, false).Equals(types.Bool(true))) + suite.EqualValues(types.String("expected"), NomsValueFromDecodedJSON("expected", false)) + suite.EqualValues(types.Bool(false), NomsValueFromDecodedJSON(false, false)) + suite.EqualValues(types.Number(1.7), NomsValueFromDecodedJSON(1.7, false)) + suite.False(NomsValueFromDecodedJSON(1.7, false).Equals(types.Bool(true))) } func (suite *LibTestSuite) TestCompositeTypes() { // [false true] suite.EqualValues( types.NewList().Append(types.Bool(false)).Append(types.Bool(true)), - util.NomsValueFromDecodedJSON([]interface{}{false, true}, false)) + NomsValueFromDecodedJSON([]interface{}{false, true}, false)) // [[false true]] suite.EqualValues( types.NewList().Append( types.NewList().Append(types.Bool(false)).Append(types.Bool(true))), - util.NomsValueFromDecodedJSON([]interface{}{[]interface{}{false, true}}, false)) + NomsValueFromDecodedJSON([]interface{}{[]interface{}{false, true}}, false)) // {"string": "string", // "list": [false true], @@ -52,7 +51,7 @@ func (suite *LibTestSuite) TestCompositeTypes() { types.NewMap( types.String("nested"), types.String("string"))) - o := util.NomsValueFromDecodedJSON(map[string]interface{}{ + o := NomsValueFromDecodedJSON(map[string]interface{}{ "string": "string", "list": []interface{}{false, true}, "map": map[string]interface{}{"nested": "string"}, @@ -73,7 +72,7 @@ func (suite *LibTestSuite) TestCompositeTypeWithStruct() { "nested": types.String("string"), }), }) - o := util.NomsValueFromDecodedJSON(map[string]interface{}{ + o := NomsValueFromDecodedJSON(map[string]interface{}{ "string": "string", "list": []interface{}{false, true}, "struct": map[string]interface{}{"nested": "string"}, @@ -83,5 +82,5 @@ func (suite *LibTestSuite) TestCompositeTypeWithStruct() { } func (suite *LibTestSuite) TestPanicOnUnsupportedType() { - suite.Panics(func() { util.NomsValueFromDecodedJSON(map[int]string{1: "one"}, false) }, "Should panic on map[int]string!") + suite.Panics(func() { NomsValueFromDecodedJSON(map[int]string{1: "one"}, false) }, "Should panic on map[int]string!") } diff --git a/samples/go/csv/csv-export/exporter.go b/samples/go/csv/csv-export/exporter.go index 40bc92bf6a..c52ff3de79 100644 --- a/samples/go/csv/csv-export/exporter.go +++ b/samples/go/csv/csv-export/exporter.go @@ -15,7 +15,6 @@ import ( "github.com/attic-labs/noms/go/spec" "github.com/attic-labs/noms/go/util/profile" "github.com/attic-labs/noms/samples/go/csv" - "github.com/attic-labs/noms/samples/go/util" ) var ( @@ -37,16 +36,16 @@ func main() { flag.Parse() if flag.NArg() != 1 { - util.CheckError(errors.New("expected dataset arg")) + d.CheckError(errors.New("expected dataset arg")) } ds, err := spec.GetDataset(flag.Arg(0)) - util.CheckError(err) + d.CheckError(err) defer ds.Database().Close() comma, err := csv.StringToRune(*delimiter) - util.CheckError(err) + d.CheckError(err) err = d.Try(func() { defer profile.MaybeStartProfile().Stop() diff --git a/samples/go/csv/csv-import/importer.go b/samples/go/csv/csv-import/importer.go index d7be02770c..e4a110cabc 100644 --- a/samples/go/csv/csv-import/importer.go +++ b/samples/go/csv/csv-import/importer.go @@ -22,7 +22,6 @@ import ( "github.com/attic-labs/noms/go/util/progressreader" "github.com/attic-labs/noms/go/util/status" "github.com/attic-labs/noms/samples/go/csv" - "github.com/attic-labs/noms/samples/go/util" humanize "github.com/dustin/go-humanize" ) @@ -58,7 +57,7 @@ func main() { if flag.NArg() != 2 { err := fmt.Errorf("Expected exactly two parameters (dataset and path) after flags, but you have %d. Maybe you put a flag after the path?", flag.NArg()) - util.CheckError(err) + d.CheckError(err) } path := flag.Arg(1) @@ -71,7 +70,7 @@ func main() { comma, err := csv.StringToRune(*delimiter) if err != nil { - util.CheckError(err) + d.CheckError(err) return } @@ -106,7 +105,7 @@ func main() { } ds, err := spec.GetDataset(flag.Arg(0)) - util.CheckError(err) + d.CheckError(err) defer ds.Database().Close() kinds := []types.NomsKind{} diff --git a/samples/go/json-import/json_importer.go b/samples/go/json-import/json_importer.go index 8cf9adc63e..b5c94181c0 100644 --- a/samples/go/json-import/json_importer.go +++ b/samples/go/json-import/json_importer.go @@ -15,7 +15,7 @@ import ( "github.com/attic-labs/noms/go/d" "github.com/attic-labs/noms/go/spec" - "github.com/attic-labs/noms/samples/go/util" + "github.com/attic-labs/noms/go/util/jsontonoms" ) func main() { @@ -28,11 +28,11 @@ func main() { flag.Parse() if len(flag.Args()) != 2 { - util.CheckError(errors.New("expected url and dataset flags")) + d.CheckError(errors.New("expected url and dataset flags")) } ds, err := spec.GetDataset(flag.Arg(1)) - util.CheckError(err) + d.CheckError(err) url := flag.Arg(0) if url == "" { @@ -53,7 +53,7 @@ func main() { log.Fatalln("Error decoding JSON: ", err) } - _, err = ds.Commit(util.NomsValueFromDecodedJSON(jsonObject, true)) + _, err = ds.Commit(jsontonoms.NomsValueFromDecodedJSON(jsonObject, true)) d.PanicIfError(err) ds.Database().Close() } diff --git a/samples/go/url-fetch/fetch.go b/samples/go/url-fetch/fetch.go index 9b496e84c8..8ea5deb1a1 100644 --- a/samples/go/url-fetch/fetch.go +++ b/samples/go/url-fetch/fetch.go @@ -20,7 +20,6 @@ import ( "github.com/attic-labs/noms/go/types" "github.com/attic-labs/noms/go/util/progressreader" "github.com/attic-labs/noms/go/util/status" - "github.com/attic-labs/noms/samples/go/util" human "github.com/dustin/go-humanize" ) @@ -38,11 +37,11 @@ func main() { flag.Parse() if flag.NArg() != 2 { - util.CheckError(errors.New("expected dataset and url arguments")) + d.CheckError(errors.New("expected dataset and url arguments")) } ds, err := spec.GetDataset(flag.Arg(0)) - util.CheckError(err) + d.CheckError(err) defer ds.Database().Close() url := flag.Arg(1) diff --git a/samples/go/util/client_flags.go b/samples/go/util/client_flags.go deleted file mode 100644 index 47d4990f5e..0000000000 --- a/samples/go/util/client_flags.go +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright 2016 The Noms Authors. All rights reserved. -// Licensed under the Apache License, version 2.0: -// http://www.apache.org/licenses/LICENSE-2.0 - -package util - -import ( - "flag" - "fmt" - "os" - - "github.com/attic-labs/noms/go/d" -) - -type ClientFlags struct { - concurrencyFlag *int - progressFileFlag *string - progressFile *os.File -} - -func NewFlags() ClientFlags { - return NewFlagsWithPrefix("") -} - -func NewFlagsWithPrefix(prefix string) ClientFlags { - return ClientFlags{ - flag.Int(prefix+"concurrency", 100, "degree of concurrency"), - flag.String(prefix+"progress-file", "", "file for logging progress"), - nil, - } -} - -func (cf *ClientFlags) Concurrency() int { - return *cf.concurrencyFlag -} - -func (cf *ClientFlags) CreateProgressFile() error { - if *cf.progressFileFlag == "" { - return fmt.Errorf("No progress file specified") - } - pf, err := os.Create(*cf.progressFileFlag) - if err != nil { - return fmt.Errorf("Unable to create progress status file: %s, err: %s", *cf.progressFileFlag, err) - } - cf.progressFile = pf - cf.UpdateProgress(0.0) - return err -} - -func (cf *ClientFlags) CloseProgressFile() { - d.Chk.True(cf.progressFile != nil, "Progress file was never created") - cf.progressFile.Close() -} - -func (cf *ClientFlags) UpdateProgress(pct float32) { - d.Chk.True(pct >= 0.0 && pct <= 1.0, "%.6f is not a valid percentage, must be in range [0, 1]", pct) - if cf.progressFile != nil { - cf.progressFile.WriteString(fmt.Sprintf("%.6f\n", pct)) - } -} diff --git a/samples/go/util/httpcache.go b/samples/go/util/httpcache.go deleted file mode 100644 index 9bcee4d26f..0000000000 --- a/samples/go/util/httpcache.go +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright 2016 The Noms Authors. All rights reserved. -// Licensed under the Apache License, version 2.0: -// http://www.apache.org/licenses/LICENSE-2.0 - -package util - -import ( - "flag" - "net/http" - "os/user" - "path" - - "github.com/attic-labs/noms/go/d" - "github.com/gregjones/httpcache" - "github.com/gregjones/httpcache/diskcache" -) - -const ( - defaultDiskCacheDir = "~/noms/httpcache" -) - -var ( - diskCacheDir = flag.String("http-cache-dir", defaultDiskCacheDir, "a directory to use for an http disk cache between runs") -) - -func CachingHttpClient() *http.Client { - if *diskCacheDir == "" { - return nil - } - - if *diskCacheDir == defaultDiskCacheDir { - user, err := user.Current() - d.Chk.NoError(err) - *diskCacheDir = path.Join(user.HomeDir, "noms", "httpcache") - } - - return httpcache.NewTransport(diskcache.New(*diskCacheDir)).Client() -} diff --git a/samples/go/util/rungen.go b/samples/go/util/rungen.go deleted file mode 100644 index 970f5fe676..0000000000 --- a/samples/go/util/rungen.go +++ /dev/null @@ -1,7 +0,0 @@ -// Copyright 2016 The Noms Authors. All rights reserved. -// Licensed under the Apache License, version 2.0: -// http://www.apache.org/licenses/LICENSE-2.0 - -package util - -//go:generate go run ../../nomdl/codegen/codegen.go diff --git a/samples/go/xml-import/xml_importer.go b/samples/go/xml-import/xml_importer.go index 0e4ed32e09..e2ce6c66ba 100644 --- a/samples/go/xml-import/xml_importer.go +++ b/samples/go/xml-import/xml_importer.go @@ -18,8 +18,8 @@ import ( "github.com/attic-labs/noms/go/d" "github.com/attic-labs/noms/go/spec" "github.com/attic-labs/noms/go/types" + "github.com/attic-labs/noms/go/util/jsontonoms" "github.com/attic-labs/noms/go/util/profile" - "github.com/attic-labs/noms/samples/go/util" "github.com/clbanning/mxj" ) @@ -56,11 +56,11 @@ func main() { flag.Parse() if flag.NArg() != 2 { - util.CheckError(errors.New("Expected dataset followed by directory path")) + d.CheckError(errors.New("Expected dataset followed by directory path")) } dir := flag.Arg(1) ds, err := spec.GetDataset(flag.Arg(0)) - util.CheckError(err) + d.CheckError(err) defer profile.MaybeStartProfile().Stop() @@ -97,7 +97,7 @@ func main() { object := xmlObject.Old() file.Close() - nomsObj := util.NomsValueFromDecodedJSON(object, false) + nomsObj := jsontonoms.NomsValueFromDecodedJSON(object, false) d.Chk.IsType(expectedType, nomsObj) var r types.Ref