From 05ccf94f6d319e9d73dba238d1e78ed139ae93b9 Mon Sep 17 00:00:00 2001 From: Nathan Baulch Date: Wed, 15 Jan 2025 15:07:13 +1100 Subject: [PATCH] fix: typos --- examples/gsutil/gsutil-example.sh | 2 +- examples/python/python.py | 2 +- fakestorage/{mux_tranport.go => mux_transport.go} | 0 fakestorage/object.go | 2 +- fakestorage/object_test.go | 4 ++-- fakestorage/server_test.go | 4 ++-- internal/backend/fs.go | 4 ++-- internal/backend/storage.go | 2 +- internal/notification/event.go | 2 +- 9 files changed, 11 insertions(+), 11 deletions(-) rename fakestorage/{mux_tranport.go => mux_transport.go} (100%) diff --git a/examples/gsutil/gsutil-example.sh b/examples/gsutil/gsutil-example.sh index 6890765376..1058a79535 100755 --- a/examples/gsutil/gsutil-example.sh +++ b/examples/gsutil/gsutil-example.sh @@ -16,7 +16,7 @@ gsutil -o "Credentials:gs_json_host=127.0.0.1" -o "Credentials:gs_json_port=4443 # list objects in the bucket (should be empty) gsutil -o "Credentials:gs_json_host=127.0.0.1" -o "Credentials:gs_json_port=4443" -o "Boto:https_validate_certificates=False" ls -p "${project_id}" "gs://${bucket_name}" -# upload a couple of fileds +# upload a couple of files gsutil -o "Credentials:gs_json_host=127.0.0.1" -o "Credentials:gs_json_port=4443" -o "Boto:https_validate_certificates=False" cp "${here}"/hello.txt "${here}"/image.png "gs://${bucket_name}/" # list objects in the bucket (should include the files that were just uploaded) diff --git a/examples/python/python.py b/examples/python/python.py index e1743d9997..a18358b769 100644 --- a/examples/python/python.py +++ b/examples/python/python.py @@ -6,7 +6,7 @@ # 1 - Build the docker image by running the command "docker build -t fsouza/fake-gcs-server ." # 2 - Start the docker container: "docker run -d --name fake-gcs-server -p 4443:4443 -v ${PWD}/examples/data:/data fsouza/fake-gcs-server -scheme http" # 3 - Check if it's working by running: "curl http://0.0.0.0:4443/storage/v1/b" -# 4 - Create a python virtual enviroment (Ex: python -m .venv venv) +# 4 - Create a python virtual environment (Ex: python -m .venv venv) # 5 - Source the env (source .venv/bin/activate) # 7 - Go to the following directory examples/python: (cd examples/python) # 6 - Install requirements: "pip install -r requirements.txt" diff --git a/fakestorage/mux_tranport.go b/fakestorage/mux_transport.go similarity index 100% rename from fakestorage/mux_tranport.go rename to fakestorage/mux_transport.go diff --git a/fakestorage/object.go b/fakestorage/object.go index 664751ee44..951c40456a 100644 --- a/fakestorage/object.go +++ b/fakestorage/object.go @@ -852,7 +852,7 @@ func (s *Server) rewriteObject(r *http.Request) jsonResponse { return jsonResponse{errorMessage: "Invalid metadata", status: http.StatusBadRequest} } - // Only supplied metadata overwrites the new object's metdata + // Only supplied metadata overwrites the new object's metadata if len(metadata.Metadata) == 0 { metadata.Metadata = obj.Metadata } diff --git a/fakestorage/object_test.go b/fakestorage/object_test.go index 6ed1fee528..dee52e3fa2 100644 --- a/fakestorage/object_test.go +++ b/fakestorage/object_test.go @@ -414,7 +414,7 @@ func TestServerClientObjectTranscoding(t *testing.T) { const ( bucketName = "some-bucket" objectName = "items/data.txt" - content = "some nice content, which will be gziped" + content = "some nice content, which will be gzipped" contentType = "text/plain; charset=utf-8" contentEncoding = "gzip" ) @@ -471,7 +471,7 @@ func TestServerClientObjectSkipTranscoding(t *testing.T) { const ( bucketName = "some-bucket" objectName = "items/data.txt" - content = "some nice content, which will be gziped" + content = "some nice content, which will be gzipped" contentType = "text/plain; charset=utf-8" contentEncoding = "gzip" ) diff --git a/fakestorage/server_test.go b/fakestorage/server_test.go index 0b81bcede1..bbdbd073ff 100644 --- a/fakestorage/server_test.go +++ b/fakestorage/server_test.go @@ -122,7 +122,7 @@ func TestGenerateObjectsFromFiles(t *testing.T) { }, }, { - name: "should skip inexistent folder", + name: "should skip nonexistent folder", folder: "../testdata/i-dont-exist", }, { @@ -458,7 +458,7 @@ func TestDownloadPartialPublicHostMatch(t *testing.T) { } } -func TestDownloadPartialHostValidationShouldntValidatePortPartially(t *testing.T) { +func TestDownloadPartialHostValidationShouldNotValidatePortPartially(t *testing.T) { server, err := NewServerWithOptions(Options{PublicHost: "127.0.0.1", InitialObjects: []Object{ {ObjectAttrs: ObjectAttrs{BucketName: "some-bucket", Name: "files/txt/text-01.txt"}, Content: []byte("something")}, }}) diff --git a/internal/backend/fs.go b/internal/backend/fs.go index d915ac1b7a..d52ec98bb9 100644 --- a/internal/backend/fs.go +++ b/internal/backend/fs.go @@ -277,7 +277,7 @@ func (s *storageFS) CreateObject(obj StreamingObject, conditions Conditions) (St } // ListObjects lists the objects in a given bucket with a given prefix and -// delimeter. +// delimiter. func (s *storageFS) ListObjects(bucketName string, prefix string, versions bool) ([]ObjectAttrs, error) { s.mtx.RLock() defer s.mtx.RUnlock() @@ -318,7 +318,7 @@ func (s *storageFS) GetObject(bucketName, objectName string) (StreamingObject, e return s.getObject(bucketName, objectName) } -// GetObjectWithGeneration retrieves an specific version of the object. Not +// GetObjectWithGeneration retrieves a specific version of the object. Not // implemented for this backend. func (s *storageFS) GetObjectWithGeneration(bucketName, objectName string, generation int64) (StreamingObject, error) { obj, err := s.GetObject(bucketName, objectName) diff --git a/internal/backend/storage.go b/internal/backend/storage.go index c428fcc8d2..9b953a9bcd 100644 --- a/internal/backend/storage.go +++ b/internal/backend/storage.go @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// Package backend proides the backends used by fake-gcs-server. +// Package backend provides the backends used by fake-gcs-server. package backend type Conditions interface { diff --git a/internal/notification/event.go b/internal/notification/event.go index f20ac8c87a..7943d0aef5 100644 --- a/internal/notification/event.go +++ b/internal/notification/event.go @@ -67,7 +67,7 @@ type PubsubEventManager struct { notifyOn EventNotificationOptions // writer is where logs are written to. writer io.Writer - // bucket, if not empty, only objects from this bucker will generate trigger events. + // bucket, if not empty, only objects from this bucket will generate trigger events. bucket string // objectPrefix, if not empty, only objects having this prefix will generate // trigger events.