Skip to content

Commit 6ba366c

Browse files
committed
cue/load: deduplicate underscore import of ./pkg
Spotted in passing. Harmless, but also unnecessary. Move it to doc.go near the package documentation, which is the closest to a top-level file we have for this package. While here, remove an unnecessary newline in pkg/register.go. Signed-off-by: Daniel Martí <[email protected]> Change-Id: I59bca21889158b231600bd1326752abb8fed0262 Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1201389 TryBot-Result: CUEcueckoo <[email protected]> Reviewed-by: Roger Peppe <[email protected]> Unity-Result: CUE porcuepine <[email protected]>
1 parent 11e06e1 commit 6ba366c

File tree

4 files changed

+6
-13
lines changed

4 files changed

+6
-13
lines changed

cue/load/doc.go

+6
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,9 @@
1414

1515
// Package load loads CUE instances.
1616
package load
17+
18+
// Trigger the unconditional loading of all core builtin packages if load is used.
19+
// This was deemed the simplest way to avoid having to import this line explicitly,
20+
// and thus breaking existing code, for the majority of cases,
21+
// while not introducing an import cycle.
22+
import _ "cuelang.org/go/pkg"

cue/load/instances.go

-6
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,6 @@ import (
3030
"cuelang.org/go/internal/mod/modpkgload"
3131
"cuelang.org/go/internal/mod/modrequirements"
3232
"cuelang.org/go/mod/module"
33-
34-
// Trigger the unconditional loading of all core builtin packages if load
35-
// is used. This was deemed the simplest way to avoid having to import
36-
// this line explicitly, and thus breaking existing code, for the majority
37-
// of cases, while not introducing an import cycle.
38-
_ "cuelang.org/go/pkg"
3933
)
4034

4135
// Instances returns the instances named by the command line arguments 'args'.

cue/load/loader.go

-6
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,6 @@ import (
2626
"cuelang.org/go/cue/errors"
2727
"cuelang.org/go/cue/token"
2828
"cuelang.org/go/internal/mod/modpkgload"
29-
30-
// Trigger the unconditional loading of all core builtin packages if load
31-
// is used. This was deemed the simplest way to avoid having to import
32-
// this line explicitly, and thus breaking existing code, for the majority
33-
// of cases, while not introducing an import cycle.
34-
_ "cuelang.org/go/pkg"
3529
)
3630

3731
type loader struct {

pkg/register.go

-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ import (
2727
_ "cuelang.org/go/pkg/encoding/json"
2828
_ "cuelang.org/go/pkg/encoding/yaml"
2929
_ "cuelang.org/go/pkg/html"
30-
3130
_ "cuelang.org/go/pkg/list"
3231
_ "cuelang.org/go/pkg/math"
3332
_ "cuelang.org/go/pkg/math/bits"

0 commit comments

Comments
 (0)