Skip to content

Commit

Permalink
cue/load: deduplicate underscore import of ./pkg
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
mvdan committed Sep 18, 2024
1 parent 11e06e1 commit 6ba366c
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 13 deletions.
6 changes: 6 additions & 0 deletions cue/load/doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,9 @@

// Package load loads CUE instances.
package load

// Trigger the unconditional loading of all core builtin packages if load is used.
// This was deemed the simplest way to avoid having to import this line explicitly,
// and thus breaking existing code, for the majority of cases,
// while not introducing an import cycle.
import _ "cuelang.org/go/pkg"
6 changes: 0 additions & 6 deletions cue/load/instances.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,6 @@ import (
"cuelang.org/go/internal/mod/modpkgload"
"cuelang.org/go/internal/mod/modrequirements"
"cuelang.org/go/mod/module"

// Trigger the unconditional loading of all core builtin packages if load
// is used. This was deemed the simplest way to avoid having to import
// this line explicitly, and thus breaking existing code, for the majority
// of cases, while not introducing an import cycle.
_ "cuelang.org/go/pkg"
)

// Instances returns the instances named by the command line arguments 'args'.
Expand Down
6 changes: 0 additions & 6 deletions cue/load/loader.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,6 @@ import (
"cuelang.org/go/cue/errors"
"cuelang.org/go/cue/token"
"cuelang.org/go/internal/mod/modpkgload"

// Trigger the unconditional loading of all core builtin packages if load
// is used. This was deemed the simplest way to avoid having to import
// this line explicitly, and thus breaking existing code, for the majority
// of cases, while not introducing an import cycle.
_ "cuelang.org/go/pkg"
)

type loader struct {
Expand Down
1 change: 0 additions & 1 deletion pkg/register.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ import (
_ "cuelang.org/go/pkg/encoding/json"
_ "cuelang.org/go/pkg/encoding/yaml"
_ "cuelang.org/go/pkg/html"

_ "cuelang.org/go/pkg/list"
_ "cuelang.org/go/pkg/math"
_ "cuelang.org/go/pkg/math/bits"
Expand Down

0 comments on commit 6ba366c

Please sign in to comment.