From 4d4891588d8d3bc9a5085372e0d27df17742778a Mon Sep 17 00:00:00 2001 From: Adriano Date: Thu, 11 Jul 2019 10:29:52 -0700 Subject: [PATCH] address comments --- audit/audit.go | 4 ++-- cmd/sops/common/common.go | 4 ++-- publish/gcs.go | 4 ++-- publish/s3.go | 4 ++-- sops.go | 2 +- stores/yaml/store.go | 4 ++-- 6 files changed, 11 insertions(+), 11 deletions(-) diff --git a/audit/audit.go b/audit/audit.go index 2b33bca09..21fca9fcc 100644 --- a/audit/audit.go +++ b/audit/audit.go @@ -81,7 +81,7 @@ func Register(auditor Auditor) { auditors = append(auditors, auditor) } -// Auditor is notified when noteworthy events happen, for example when a file is encrypted or decrypted. +// Auditor is notified when noteworthy events happen, for example when a file is encrypted or decrypted. type Auditor interface { Handle(event interface{}) } @@ -107,7 +107,7 @@ type PostgresAuditor struct { DB *sql.DB } -// NewPostgresAuditor is the constructor for a new PostgresAuditor object +// NewPostgresAuditor is the constructor for a new PostgresAuditor struct // initialized with the given db connection string func NewPostgresAuditor(connStr string) (*PostgresAuditor, error) { db, err := sql.Open("postgres", connStr) diff --git a/cmd/sops/common/common.go b/cmd/sops/common/common.go index 1fca82ebc..ebe057e9a 100644 --- a/cmd/sops/common/common.go +++ b/cmd/sops/common/common.go @@ -24,8 +24,8 @@ import ( "gopkg.in/urfave/cli.v1" ) -// ExampleFileEmitter represents actions needed for a struct to be comliant -// with the sops example-file emitter interface +// ExampleFileEmitter emits example files. This is used by the `sops` binary +// whenever a new file is created, in order to present the user with a non-empty file type ExampleFileEmitter interface { EmitExample() []byte } diff --git a/publish/gcs.go b/publish/gcs.go index fad62cfb8..44a3e8b3f 100644 --- a/publish/gcs.go +++ b/publish/gcs.go @@ -13,7 +13,7 @@ type GCSDestination struct { gcsPrefix string } -// NewGCSDestination is the constructor for a new Google Cloud Storage destination +// NewGCSDestination is the constructor for a Google Cloud Storage destination func NewGCSDestination(gcsBucket string, gcsPrefix string) *GCSDestination { return &GCSDestination{gcsBucket, gcsPrefix} } @@ -23,7 +23,7 @@ func (gcsd *GCSDestination) Path(fileName string) string { return fmt.Sprintf("gcs://%s/%s%s", gcsd.gcsBucket, gcsd.gcsPrefix, fileName) } -// Upload uploads contents to a new file in GCS +// Upload uploads contents to a file in GCS func (gcsd *GCSDestination) Upload(fileContents []byte, fileName string) error { ctx := context.Background() client, err := storage.NewClient(ctx) diff --git a/publish/s3.go b/publish/s3.go index 80fbe3763..2010c692e 100644 --- a/publish/s3.go +++ b/publish/s3.go @@ -15,7 +15,7 @@ type S3Destination struct { s3Prefix string } -// NewS3Destination is the constructor for a new S3 Destination +// NewS3Destination is the constructor for an S3 Destination func NewS3Destination(s3Bucket string, s3Prefix string) *S3Destination { return &S3Destination{s3Bucket, s3Prefix} } @@ -25,7 +25,7 @@ func (s3d *S3Destination) Path(fileName string) string { return fmt.Sprintf("s3://%s/%s%s", s3d.s3Bucket, s3d.s3Prefix, fileName) } -// Upload uploads contents to a new file in an S3 Destination (bucket) +// Upload uploads contents to a file in an S3 Destination (bucket) func (s3d *S3Destination) Upload(fileContents []byte, fileName string) error { sess := session.Must(session.NewSession()) svc := s3.New(sess) diff --git a/sops.go b/sops.go index 8cc244981..bc46f79f8 100644 --- a/sops.go +++ b/sops.go @@ -101,7 +101,7 @@ type TreeItem struct { type TreeBranch []TreeItem // TreeBranches is a collection of TreeBranch -// trees usually have more than one branch +// Trees usually have more than one branch type TreeBranches []TreeBranch func valueFromPathAndLeaf(path []interface{}, leaf interface{}) interface{} { diff --git a/stores/yaml/store.go b/stores/yaml/store.go index 06a185207..c897f537e 100644 --- a/stores/yaml/store.go +++ b/stores/yaml/store.go @@ -101,7 +101,7 @@ func (store Store) treeBranchToYamlMap(in sops.TreeBranch) yaml.MapSlice { return branch } -// LoadEncryptedFile loads the contexts of an encrypted yaml file onto a +// LoadEncryptedFile loads the contents of an encrypted yaml file onto a // sops.Tree runtime object func (store *Store) LoadEncryptedFile(in []byte) (sops.Tree, error) { var data []yaml.MapSlice @@ -138,7 +138,7 @@ func (store *Store) LoadEncryptedFile(in []byte) (sops.Tree, error) { }, nil } -// LoadPlainFile loads the contexts of a plaintext yaml file onto a +// LoadPlainFile loads the contents of a plaintext yaml file onto a // sops.Tree runtime obejct func (store *Store) LoadPlainFile(in []byte) (sops.TreeBranches, error) { var data []yaml.MapSlice