diff --git a/Makefile b/Makefile index 06d34d1b8..4c536f1aa 100644 --- a/Makefile +++ b/Makefile @@ -129,7 +129,7 @@ vet: ## Runs go vet ${GO} vet ./... staticcheck: ## Runs staticcheck - ${GO} run honnef.co/go/tools/cmd/staticcheck ./... + ${GO} list ./... | grep -v 'fakes$$' | xargs ${GO} run honnef.co/go/tools/cmd/staticcheck ###### Format ################################################################# diff --git a/brokerapi/staticcheck.conf b/brokerapi/staticcheck.conf new file mode 100644 index 000000000..5f0a3482d --- /dev/null +++ b/brokerapi/staticcheck.conf @@ -0,0 +1 @@ +checks = ["all", "-ST1000"] diff --git a/brokerpaktestframework/brokerpaktestframework.go b/brokerpaktestframework/brokerpaktestframework.go new file mode 100644 index 000000000..0fe5e08e6 --- /dev/null +++ b/brokerpaktestframework/brokerpaktestframework.go @@ -0,0 +1,2 @@ +// Package brokerpaktestframework implements a test framework that can be used by brokerpaks for testing +package brokerpaktestframework diff --git a/cmd/cmd.go b/cmd/cmd.go new file mode 100644 index 000000000..1ecae02a7 --- /dev/null +++ b/cmd/cmd.go @@ -0,0 +1,2 @@ +// Package cmd implements a command line interface using Cobra +package cmd diff --git a/dbservice/dbservice.go b/dbservice/dbservice.go index 6e09b1b8e..a418da2c8 100644 --- a/dbservice/dbservice.go +++ b/dbservice/dbservice.go @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. +// Package dbservice implements database setup, connection, and migration package dbservice import ( diff --git a/dbservice/models/db.go b/dbservice/models/db.go index 18a76e944..1a4ab602a 100644 --- a/dbservice/models/db.go +++ b/dbservice/models/db.go @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. +// Package models implements database object models for use with GORM package models const ( diff --git a/integrationtest/helper/helper.go b/integrationtest/helper/helper.go new file mode 100644 index 000000000..534616f15 --- /dev/null +++ b/integrationtest/helper/helper.go @@ -0,0 +1,2 @@ +// Package helper implements some test helpers for the integration tests +package helper diff --git a/internal/brokerpak/platform/platform.go b/internal/brokerpak/platform/platform.go index c13b9b2cb..f4a913737 100644 --- a/internal/brokerpak/platform/platform.go +++ b/internal/brokerpak/platform/platform.go @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. +// Package platform is a utility for handling platform data package platform import ( diff --git a/internal/brokerpak/reader/reader.go b/internal/brokerpak/reader/reader.go index 26e956b9a..5aed1a12a 100644 --- a/internal/brokerpak/reader/reader.go +++ b/internal/brokerpak/reader/reader.go @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. +// Package reader is for reading manifest files package reader import ( diff --git a/internal/createservice/create_service.go b/internal/createservice/create_service.go index bac9755b8..8284a372f 100644 --- a/internal/createservice/create_service.go +++ b/internal/createservice/create_service.go @@ -1,3 +1,4 @@ +// Package createservice is an experimental mimic for the "cf create-service" command package createservice import ( diff --git a/internal/encryption/compoundencryptor/compoundencryptor.go b/internal/encryption/compoundencryptor/compoundencryptor.go index 7630e742f..cf9f6f0d8 100644 --- a/internal/encryption/compoundencryptor/compoundencryptor.go +++ b/internal/encryption/compoundencryptor/compoundencryptor.go @@ -1,3 +1,4 @@ +// Package compoundencryptor allows encryptors to be combined package compoundencryptor import "github.com/cloudfoundry/cloud-service-broker/internal/storage" diff --git a/internal/encryption/encryption.go b/internal/encryption/encryption.go new file mode 100644 index 000000000..d0b91af02 --- /dev/null +++ b/internal/encryption/encryption.go @@ -0,0 +1,2 @@ +// Package encryption handles encryption of secrets +package encryption diff --git a/internal/encryption/gcmencryptor/gcmencryptor.go b/internal/encryption/gcmencryptor/gcmencryptor.go index 8be75ec0c..afe12d2e8 100644 --- a/internal/encryption/gcmencryptor/gcmencryptor.go +++ b/internal/encryption/gcmencryptor/gcmencryptor.go @@ -1,3 +1,4 @@ +// Package gcmencryptor implements AES GCM encryption package gcmencryptor import ( diff --git a/internal/encryption/noopencryptor/noopencryptor.go b/internal/encryption/noopencryptor/noopencryptor.go index 0b4e4e1aa..4316d0422 100644 --- a/internal/encryption/noopencryptor/noopencryptor.go +++ b/internal/encryption/noopencryptor/noopencryptor.go @@ -1,3 +1,4 @@ +// Package noopencryptor looks like an encryptor but doesn't do any encryption package noopencryptor func New() NoopEncryptor { diff --git a/internal/encryption/passwordcombiner/combiner.go b/internal/encryption/passwordcombiner/combiner.go index d5d474fb6..396e9c911 100644 --- a/internal/encryption/passwordcombiner/combiner.go +++ b/internal/encryption/passwordcombiner/combiner.go @@ -1,3 +1,4 @@ +// Package passwordcombiner combines passwords with salt to create encryption keys package passwordcombiner import ( diff --git a/internal/encryption/passwordparser/parser.go b/internal/encryption/passwordparser/parser.go index 677eec62a..e194ee27e 100644 --- a/internal/encryption/passwordparser/parser.go +++ b/internal/encryption/passwordparser/parser.go @@ -1,3 +1,4 @@ +// Package passwordparser parses password data package passwordparser import ( diff --git a/internal/infohandler/infohandler.go b/internal/infohandler/infohandler.go index fcaa966ae..69a30621e 100644 --- a/internal/infohandler/infohandler.go +++ b/internal/infohandler/infohandler.go @@ -1,3 +1,4 @@ +// Package infohandler handles the /info endpoint package infohandler import ( diff --git a/internal/paramparser/paramparser.go b/internal/paramparser/paramparser.go new file mode 100644 index 000000000..0b5c11f46 --- /dev/null +++ b/internal/paramparser/paramparser.go @@ -0,0 +1,2 @@ +// Package paramparser handles the parsing of parameters from brokerapi +package paramparser diff --git a/internal/storage/storage.go b/internal/storage/storage.go index 684e1a492..96a992208 100644 --- a/internal/storage/storage.go +++ b/internal/storage/storage.go @@ -1,3 +1,4 @@ +// Package storage implements a Database Access Object (DAO) package storage import "gorm.io/gorm" diff --git a/internal/testmatchers/directory_contents_matcher.go b/internal/testmatchers/directory_contents_matcher.go index c06c3f125..4974d4396 100644 --- a/internal/testmatchers/directory_contents_matcher.go +++ b/internal/testmatchers/directory_contents_matcher.go @@ -1,3 +1,4 @@ +// Package testmatchers implements custom test matchers package testmatchers import ( diff --git a/internal/tfproviderfqn/tfproviderfqn.go b/internal/tfproviderfqn/tfproviderfqn.go index a580892d4..26ed9226d 100644 --- a/internal/tfproviderfqn/tfproviderfqn.go +++ b/internal/tfproviderfqn/tfproviderfqn.go @@ -1,3 +1,4 @@ +// Package tfproviderfqn implements fully qualified Terraform provider names package tfproviderfqn import "fmt" diff --git a/pkg/staticcheck.conf b/pkg/staticcheck.conf new file mode 100644 index 000000000..5f0a3482d --- /dev/null +++ b/pkg/staticcheck.conf @@ -0,0 +1 @@ +checks = ["all", "-ST1000"] diff --git a/staticcheck.conf b/staticcheck.conf index 5f0a3482d..528438b97 100644 --- a/staticcheck.conf +++ b/staticcheck.conf @@ -1 +1 @@ -checks = ["all", "-ST1000"] +checks = ["all"] diff --git a/utils/correlation/correlation.go b/utils/correlation/correlation.go index 2f1f8005b..98f4022b8 100644 --- a/utils/correlation/correlation.go +++ b/utils/correlation/correlation.go @@ -1,3 +1,4 @@ +// Package correlation reads correlation IDs from the context for logging package correlation import ( diff --git a/utils/freeport/freeport.go b/utils/freeport/freeport.go index c00218189..ef4d05b75 100644 --- a/utils/freeport/freeport.go +++ b/utils/freeport/freeport.go @@ -1,3 +1,4 @@ +// Package freeport identifies a random unused port package freeport import ( diff --git a/utils/request/request_parser.go b/utils/request/request_parser.go index fb3f7980f..497577641 100644 --- a/utils/request/request_parser.go +++ b/utils/request/request_parser.go @@ -1,3 +1,4 @@ +// Package request decodes the originating identity header package request import ( diff --git a/utils/stream/stream.go b/utils/stream/stream.go index 84ceb181a..c10bb297f 100644 --- a/utils/stream/stream.go +++ b/utils/stream/stream.go @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. +// Package stream implements streaming a bit like 'gulp' on nodejs package stream import ( diff --git a/utils/utils.go b/utils/utils.go index de42e579f..79e8713dd 100644 --- a/utils/utils.go +++ b/utils/utils.go @@ -12,6 +12,9 @@ // See the License for the specific language governing permissions and // limitations under the License. +// Package utils contains various utils that do various things. +// It is deprecated and any future utils should be added as an appropriately named sub-package. +// Over time this package should be emptied. package utils import (