Skip to content

Commit

Permalink
chore: upgrade golangci-lint
Browse files Browse the repository at this point in the history
With goimports also upgraded, several comment whitespace related changes have been made.

Updated scripts/license.sh to only change the year range on files modified in the current branch.
  • Loading branch information
dougm committed Mar 17, 2023
1 parent b838c5c commit 5b3da2e
Show file tree
Hide file tree
Showing 41 changed files with 423 additions and 930 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ lint-go: $(GOLANGCI_LINT) ## Lint codebase
$(GOLANGCI_LINT) run -v $(GOLANGCI_LINT_FLAGS)

.PHONY: lint-go-full
lint-go-full: GOLANGCI_LINT_FLAGS = --fast=false
lint-go-full: GOLANGCI_LINT_FLAGS = --fast=false --max-same-issues=200
lint-go-full: lint-go ## Run slower linters to detect possible issues

.PHONY: fix
Expand Down
14 changes: 7 additions & 7 deletions client.go
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/*
Copyright (c) 2014-2016 VMware, Inc. All Rights Reserved.
Copyright (c) 2014-2023 VMware, Inc. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
Expand All @@ -19,7 +19,7 @@ This package is the root package of the govmomi library.
The library is structured as follows:
Package vim25
# Package vim25
The minimal usable functionality is available through the vim25 package.
It contains subpackages that contain generated types, managed objects, and all
Expand All @@ -30,25 +30,25 @@ The vim25 package itself contains a client structure that is
passed around throughout the entire library. It abstracts a session and its
immutable state. See the vim25 package for more information.
Package session
# Package session
The session package contains an abstraction for the session manager that allows
a user to login and logout. It also provides access to the current session
(i.e. to determine if the user is in fact logged in)
Package object
# Package object
The object package contains wrappers for a selection of managed objects. The
constructors of these objects all take a *vim25.Client, which they pass along
to derived objects, if applicable.
Package govc
# Package govc
The govc package contains the govc CLI. The code in this tree is not intended
to be used as a library. Any functionality that govc contains that _could_ be
used as a library function but isn't, _should_ live in a root level package.
Other packages
# Other packages
Other packages, such as "event", "guest", or "license", provide wrappers for
the respective subsystems. They are typically not needed in normal workflows so
Expand Down
9 changes: 5 additions & 4 deletions event/sort.go
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/*
Copyright (c) 2015 VMware, Inc. All Rights Reserved.
Copyright (c) 2015-2023 VMware, Inc. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
Expand All @@ -24,8 +24,9 @@ import (

// Sort events in ascending order base on Key
// From the EventHistoryCollector.latestPage sdk docs:
// The "oldest event" is the one with the smallest key (event ID).
// The events in the returned page are unordered.
//
// The "oldest event" is the one with the smallest key (event ID).
// The events in the returned page are unordered.
func Sort(events []types.BaseEvent) {
sort.Sort(baseEvent(events))
}
Expand Down
4 changes: 2 additions & 2 deletions govc/flags/common.go
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/*
Copyright (c) 2015-2016 VMware, Inc. All Rights Reserved.
Copyright (c) 2015-2023 VMware, Inc. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
Expand Down
4 changes: 2 additions & 2 deletions govc/host/esxcli/response.go
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/*
Copyright (c) 2014-2015 VMware, Inc. All Rights Reserved.
Copyright (c) 2014-2023 VMware, Inc. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
Expand Down
8 changes: 4 additions & 4 deletions govc/vm/rdm/attach.go
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/*
Copyright (c) 2017 VMware, Inc. All Rights Reserved.
Copyright (c) 2017-2023 VMware, Inc. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
Expand Down Expand Up @@ -59,8 +59,8 @@ func (cmd *attach) Process(ctx context.Context) error {
return nil
}

//This piece of code was developed mainly thanks to the project govmax on github.com
//This file in particular https://github.com/codedellemc/govmax/blob/master/api/v1/vmomi.go
// This piece of code was developed mainly thanks to the project govmax on github.com
// This file in particular https://github.com/codedellemc/govmax/blob/master/api/v1/vmomi.go
func (cmd *attach) Run(ctx context.Context, f *flag.FlagSet) error {
vm, err := cmd.VirtualMachine()
if err != nil {
Expand Down
6 changes: 3 additions & 3 deletions hack/boilerplate/boilerplate.go.txt
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
/*
Copyright (c) 2014-2022 VMware, Inc. All Rights Reserved.
Copyright (c) 2014-2023 VMware, Inc. All Rights Reserved.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0
http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
*/
2 changes: 1 addition & 1 deletion hack/tools/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ help: ## Display this help
.PHONY: $(GOLANGCI_LINT)
golangci-lint: $(GOLANGCI_LINT) ## Install golangci-lint
$(GOLANGCI_LINT): go.mod
go build -tags=tools -o $@ github.com/golangci/golangci-lint/cmd/golangci-lint
go build -tags=govmomi_tools -o $@ github.com/golangci/golangci-lint/cmd/golangci-lint


## --------------------------------------
Expand Down
Loading

0 comments on commit 5b3da2e

Please sign in to comment.