Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable govet nilness check and fix infractions #2729

Merged
merged 1 commit into from
Jan 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ linters-settings:
- '^log\.'
- '^print$'
- '^println$'
govet:
enable:
- nilness
importas:
alias:
- pkg: github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/image/v1
Expand Down
3 changes: 0 additions & 3 deletions private/buf/bufsync/syncer.go
Original file line number Diff line number Diff line change
Expand Up @@ -641,9 +641,6 @@ func (s *syncer) protectSyncedModuleBranch(
if err != nil {
return fmt.Errorf("resolve sync point for module %s: %w", moduleIdentity.IdentityString(), err)
}
if err != nil {
return err
}
if syncPoint == nil {
// Branch has never been synced, there is nothing to protected against.
return nil
Expand Down
3 changes: 0 additions & 3 deletions private/buf/cmd/buf/command/beta/graph/graph.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,9 +129,6 @@ func run(
bufcli.NewFetchReader(container.Logger(), storageosProvider, runner, moduleResolver, moduleReader),
bufmodulebuild.NewModuleBucketBuilder(),
)
if err != nil {
return err
}
graphBuilder := bufgraph.NewBuilder(
container.Logger(),
moduleResolver,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ func javaMultipleFilesForFile(
// The option is already set to the same value, don't do anything.
return nil
}
case options == nil && descriptorpb.Default_FileOptions_JavaMultipleFiles == value:
case descriptorpb.Default_FileOptions_JavaMultipleFiles == value:
// The option is not set, but the value we want to set is the
// same as the default, don't do anything.
return nil
Expand Down
3 changes: 0 additions & 3 deletions private/pkg/protosource/file.go
Original file line number Diff line number Diff line change
Expand Up @@ -638,9 +638,6 @@ func (f *file) populateMessage(
getMessageExtensionPackedPath(fieldIndex, topLevelMessageIndex, nestedMessageIndexes...),
getMessageExtensionExtendeePath(fieldIndex, topLevelMessageIndex, nestedMessageIndexes...),
)
if err != nil {
return nil, err
}
message.addExtension(field)
if oneof != nil {
oneof.addField(field)
Expand Down
Loading