Skip to content

Commit

Permalink
Remove dependency on alexbrainman/goissue34681
Browse files Browse the repository at this point in the history
Now that we no longer support Windows, that's no longer necessary.
  • Loading branch information
fsouza committed Oct 31, 2022
1 parent b38adf6 commit 7524919
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 22 deletions.
1 change: 0 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ module github.com/fsouza/fake-gcs-server
require (
cloud.google.com/go/pubsub v1.26.0
cloud.google.com/go/storage v1.27.0
github.com/alexbrainman/goissue34681 v0.0.0-20191006012335-3fc7a47baff5
github.com/google/go-cmp v0.5.9
github.com/gorilla/handlers v1.5.1
github.com/gorilla/mux v1.8.0
Expand Down
2 changes: 0 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ cloud.google.com/go/pubsub v1.26.0/go.mod h1:QgBH3U/jdJy/ftjPhTkyXNj543Tin1pRYcd
cloud.google.com/go/storage v1.27.0 h1:YOO045NZI9RKfCj1c5A/ZtuuENUc8OAW+gHdGnDgyMQ=
cloud.google.com/go/storage v1.27.0/go.mod h1:x9DOL8TK/ygDUMieqwfhdpQryTeEkhGKMi80i/iqR2s=
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
github.com/alexbrainman/goissue34681 v0.0.0-20191006012335-3fc7a47baff5 h1:iW0a5ljuFxkLGPNem5Ui+KBjFJzKg4Fv2fnxe4dvzpM=
github.com/alexbrainman/goissue34681 v0.0.0-20191006012335-3fc7a47baff5/go.mod h1:Y2QMoi1vgtOIfc+6DhrMOGkLoGzqSV2rKp4Sm+opsyA=
github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=
github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc=
Expand Down
6 changes: 3 additions & 3 deletions internal/backend/fs.go
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ func (s *storageFS) CreateObject(obj StreamingObject, conditions Conditions) (St
}
tempFile.Close()

tempFile, err = compatOpenForWritingAllowingRename(tempFile.Name())
tempFile, err = os.OpenFile(tempFile.Name(), os.O_RDWR|os.O_CREATE|os.O_TRUNC, 0o666)
if err != nil {
return StreamingObject{}, err
}
Expand Down Expand Up @@ -222,7 +222,7 @@ func (s *storageFS) CreateObject(obj StreamingObject, conditions Conditions) (St
return StreamingObject{}, err
}

err = compatRename(tempFile.Name(), path)
err = os.Rename(tempFile.Name(), path)
if err != nil {
return StreamingObject{}, err
}
Expand Down Expand Up @@ -311,7 +311,7 @@ func (s *storageFS) getObject(bucketName, objectName string) (StreamingObject, e

func openObjectAndSetSize(obj *StreamingObject, path string) error {
// file is expected to be closed by the caller by calling obj.Close()
file, err := compatOpenAllowingRename(path)
file, err := os.Open(path)
if err != nil {
return err
}
Expand Down
2 changes: 1 addition & 1 deletion internal/backend/metadata_file.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,5 @@ func (m metadataFile) remove(path string) error {
}

func (m metadataFile) rename(pathSrc, pathDst string) error {
return compatRename(pathSrc+metadataSuffix, pathDst+metadataSuffix)
return os.Rename(pathSrc+metadataSuffix, pathDst+metadataSuffix)
}
15 changes: 0 additions & 15 deletions internal/backend/rename_unix.go

This file was deleted.

0 comments on commit 7524919

Please sign in to comment.