Skip to content

Commit

Permalink
Ungroup compile time interface checks and revert error message
Browse files Browse the repository at this point in the history
  • Loading branch information
mcastorina committed Feb 3, 2024
1 parent 4864eca commit 00ee5be
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions pkg/sources/gitlab/gitlab.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,9 @@ type Source struct {
func (s *Source) WithCustomContentWriter() { s.useCustomContentWriter = true }

// Ensure the Source satisfies the interfaces at compile time.
var _ interface {
sources.Source
sources.SourceUnitUnmarshaller
sources.Validator
} = (*Source)(nil)
var _ sources.Source = (*Source)(nil)
var _ sources.SourceUnitUnmarshaller = (*Source)(nil)
var _ sources.Validator = (*Source)(nil)

// Type returns the type of source.
// It is used for matching source types in configuration and job input.
Expand Down Expand Up @@ -116,7 +114,7 @@ func (s *Source) Init(_ context.Context, name string, jobId sources.JobID, sourc
// We may need the password as a token if the user is using an access_token with basic auth.
s.token = cred.BasicAuth.Password
default:
return fmt.Errorf("invalid auth method")
return fmt.Errorf("invalid configuration given for source %q (%s)", name, s.Type().String())
}

if len(s.url) == 0 {
Expand Down

0 comments on commit 00ee5be

Please sign in to comment.