Skip to content
This repository has been archived by the owner on Oct 29, 2021. It is now read-only.

Commit

Permalink
Remove Core from Module type
Browse files Browse the repository at this point in the history
Fixes #15

Signed-off-by: yugo-horie <u5.horie@gmail.com>
  • Loading branch information
u5surf committed Oct 2, 2021
1 parent 0e65d95 commit 8e02361
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
3 changes: 1 addition & 2 deletions internal/builder/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ type Module struct {
Import string `mapstructure:"import"` // if not specified, this is the path part of the go mods
GoMod string `mapstructure:"gomod"` // a gomod-compatible spec for the module
Path string `mapstructure:"path"` // an optional path to the local version of this module
Core bool `mapstructure:"core"` // whether this module comes from core, meaning that no further dependencies will be added
}

// DefaultConfig creates a new config, with default values
Expand Down Expand Up @@ -134,7 +133,7 @@ func (c *Config) ParseModules() error {
func parseModules(mods []Module) ([]Module, error) {
var parsedModules []Module
for _, mod := range mods {
if mod.GoMod == "" && !mod.Core {
if mod.GoMod == "" {
return mods, fmt.Errorf("%w, module: %q", ErrInvalidGoMod, mod.GoMod)
}

Expand Down
5 changes: 2 additions & 3 deletions internal/builder/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,9 @@ func TestRelativePath(t *testing.T) {
func TestModuleFromCore(t *testing.T) {
// prepare
cfg := Config{
Extensions: []Module{{
Core: true,
Extensions: []Module{{ // see issue-12
Import: "go.opentelemetry.io/collector/receiver/jaegerreceiver",
GoMod: "go.opentelemetry.io/collector v0.21.0",
}},
}

Expand All @@ -77,7 +77,6 @@ func TestModuleFromCore(t *testing.T) {

// verify
assert.True(t, strings.HasPrefix(cfg.Extensions[0].Name, "jaegerreceiver"))
assert.Empty(t, cfg.Extensions[0].GoMod)
}

func TestInvalidModule(t *testing.T) {
Expand Down

0 comments on commit 8e02361

Please sign in to comment.