From 513fe9fcf35b13fea43c1fcc8bcf875580d8893e Mon Sep 17 00:00:00 2001 From: Marius Date: Tue, 27 Sep 2016 22:10:16 +0200 Subject: [PATCH] Correct linting issue and misspellings --- config.go | 2 +- datastore.go | 2 +- filestore/filestore.go | 6 +++--- memorylocker/memorylocker.go | 6 +++--- metrics.go | 2 +- s3store/multi_error.go | 2 +- s3store/s3store.go | 4 ++-- s3store/s3store_test.go | 2 +- uid/uid.go | 2 +- 9 files changed, 14 insertions(+), 14 deletions(-) diff --git a/config.go b/config.go index 98ab97a..1ed82cf 100644 --- a/config.go +++ b/config.go @@ -35,7 +35,7 @@ type Config struct { Logger *log.Logger // Respect the X-Forwarded-Host, X-Forwarded-Proto and Forwarded headers // potentially set by proxies when generating an absolute URL in the - // reponse to POST requests. + // response to POST requests. RespectForwardedHeaders bool } diff --git a/datastore.go b/datastore.go index aa130b3..588199a 100644 --- a/datastore.go +++ b/datastore.go @@ -69,7 +69,7 @@ type FinisherDataStore interface { // Common ways to store this information is in memory, on disk or using an // external service, such as ZooKeeper. // When multiple processes are attempting to access an upload, whether it be -// by reading or writing, a syncronization mechanism is required to prevent +// by reading or writing, a synchronization mechanism is required to prevent // data corruption, especially to ensure correct offset values and the proper // order of chunks inside a single upload. type LockerDataStore interface { diff --git a/filestore/filestore.go b/filestore/filestore.go index 3f891e5..1d82e55 100644 --- a/filestore/filestore.go +++ b/filestore/filestore.go @@ -7,9 +7,9 @@ // No cleanup is performed so you may want to run a cronjob to ensure your disk // is not filled up with old and finished uploads. // -// In addition, it provides an exclusive upload locking mechansim using lock files +// In addition, it provides an exclusive upload locking mechanism using lock files // which are stored on disk. Each of them stores the PID of the process which -// aquired the lock. This allows locks to be automatically freed when a process +// acquired the lock. This allows locks to be automatically freed when a process // is unable to release it on its own because the process is not alive anymore. // For more information, consult the documentation for tusd.LockerDataStore // interface, which is implemented by FileStore @@ -161,7 +161,7 @@ func (store FileStore) UnlockUpload(id string) error { // A "no such file or directory" will be returned if no lockfile was found. // Since this means that the file has never been locked, we drop the error - // and continue as if nothing happend. + // and continue as if nothing happened. if os.IsNotExist(err) { err = nil } diff --git a/memorylocker/memorylocker.go b/memorylocker/memorylocker.go index a4ea689..aa0664d 100644 --- a/memorylocker/memorylocker.go +++ b/memorylocker/memorylocker.go @@ -1,12 +1,12 @@ // Package memorylocker provides an in-memory locking mechanism. // // When multiple processes are attempting to access an upload, whether it be -// by reading or writing, a syncronization mechanism is required to prevent +// by reading or writing, a synchronization mechanism is required to prevent // data corruption, especially to ensure correct offset values and the proper // order of chunks inside a single upload. // // MemoryLocker persists locks using memory and therefore allowing a simple and -// cheap mechansim. Locks will only exist as long as this object is kept in +// cheap mechanism. Locks will only exist as long as this object is kept in // reference and will be erased if the program exits. package memorylocker @@ -17,7 +17,7 @@ import ( ) // MemoryLocker persists locks using memory and therefore allowing a simple and -// cheap mechansim. Locks will only exist as long as this object is kept in +// cheap mechanism. Locks will only exist as long as this object is kept in // reference and will be erased if the program exits. type MemoryLocker struct { locks map[string]bool diff --git a/metrics.go b/metrics.go index 64275e0..92df351 100644 --- a/metrics.go +++ b/metrics.go @@ -80,7 +80,7 @@ func newMetrics() Metrics { func newErrorsTotalMap() map[string]*uint64 { m := make(map[string]*uint64, len(ErrStatusCodes)+1) - for err, _ := range ErrStatusCodes { + for err := range ErrStatusCodes { m[err.Error()] = new(uint64) } diff --git a/s3store/multi_error.go b/s3store/multi_error.go index 7bdb830..a2d9e3d 100644 --- a/s3store/multi_error.go +++ b/s3store/multi_error.go @@ -5,7 +5,7 @@ import ( ) func newMultiError(errs []error) error { - message := "Multiple errors occured:\n" + message := "Multiple errors occurred:\n" for _, err := range errs { message += "\t" + err.Error() + "\n" } diff --git a/s3store/s3store.go b/s3store/s3store.go index 7b467e6..f006163 100644 --- a/s3store/s3store.go +++ b/s3store/s3store.go @@ -272,7 +272,7 @@ func (store S3Store) WriteChunk(id string, offset int64, src io.Reader) (int64, func (store S3Store) GetInfo(id string) (info tusd.FileInfo, err error) { uploadId, multipartId := splitIds(id) - // Get file info stored in seperate object + // Get file info stored in separate object res, err := store.Service.GetObject(&s3.GetObjectInput{ Bucket: aws.String(store.Bucket), Key: aws.String(uploadId + ".info"), @@ -335,7 +335,7 @@ func (store S3Store) GetReader(id string) (io.Reader, error) { Key: aws.String(uploadId), }) if err == nil { - // No error occured, and we are able to stream the object + // No error occurred, and we are able to stream the object return res.Body, nil } diff --git a/s3store/s3store_test.go b/s3store/s3store_test.go index de45129..d3f3c82 100644 --- a/s3store/s3store_test.go +++ b/s3store/s3store_test.go @@ -538,7 +538,7 @@ func TestTerminateWithErrors(t *testing.T) { }, nil) err := store.Terminate("uploadId+multipartId") - assert.Equal("Multiple errors occured:\n\tAWS S3 Error (hello) for object uploadId: it's me.\n", err.Error()) + assert.Equal("Multiple errors occurred:\n\tAWS S3 Error (hello) for object uploadId: it's me.\n", err.Error()) } func TestConcatUploads(t *testing.T) { diff --git a/uid/uid.go b/uid/uid.go index 1b53cdc..71f0cb3 100644 --- a/uid/uid.go +++ b/uid/uid.go @@ -15,7 +15,7 @@ func Uid() string { id := make([]byte, 16) _, err := io.ReadFull(rand.Reader, id) if err != nil { - // This is probably an appropiate way to handle errors from our source + // This is probably an appropriate way to handle errors from our source // for random bits. panic(err) }