From acb58a2c9d50b809a4661375f8ec9c2310a713b7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 16 Sep 2024 21:49:40 +0200 Subject: [PATCH] Bump go.nhat.io/aferomock from 0.4.0 to 0.6.0 (#45) * Bump go.nhat.io/aferomock from 0.4.0 to 0.6.0 Bumps [go.nhat.io/aferomock](https://github.com/nhatthm/aferomock) from 0.4.0 to 0.6.0. - [Release notes](https://github.com/nhatthm/aferomock/releases) - [Commits](https://github.com/nhatthm/aferomock/compare/v0.4.0...v0.6.0) --- updated-dependencies: - dependency-name: go.nhat.io/aferomock dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] * Fix broken tests --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: nhatthm --- .golangci.yaml | 16 ++++++---------- Makefile | 2 +- copy_namedpipes_test.go | 2 +- copy_namedpipes_x_test.go | 2 +- copy_test.go | 12 ++++++------ example_test.go | 4 ++-- go.mod | 8 +++----- go.sum | 32 +++++++++++++++++++++++++++----- permission_control_test.go | 10 +++++----- 9 files changed, 52 insertions(+), 36 deletions(-) diff --git a/.golangci.yaml b/.golangci.yaml index 051a423..d6ad23e 100644 --- a/.golangci.yaml +++ b/.golangci.yaml @@ -20,30 +20,25 @@ linters-settings: linters: enable-all: true disable: - - deadcode + - copyloopvar - depguard - - exhaustivestruct + - execinquery - exhaustruct + - exportloopref - forbidigo - forcetypeassert - gci - gochecknoglobals - - golint - gomnd - - ifshort - - interfacer + - intrange - ireturn - lll - - maligned + - mnd - nonamedreturns - - nosnakecase - nolintlint # https://github.com/golangci/golangci-lint/issues/3063 - paralleltest - - scopelint - - structcheck - tagliatelle - testpackage - - varcheck - varnamelen - wrapcheck @@ -52,6 +47,7 @@ issues: exclude-rules: - linters: - dupl + - err113 - funlen - goconst - goerr113 diff --git a/Makefile b/Makefile index 2d6e2ea..694bd8c 100644 --- a/Makefile +++ b/Makefile @@ -2,7 +2,7 @@ MODULE_NAME=aferocopy VENDOR_DIR = vendor -GOLANGCI_LINT_VERSION ?= v1.55.2 +GOLANGCI_LINT_VERSION ?= v1.61.0 GO ?= go GOLANGCI_LINT ?= $(shell go env GOPATH)/bin/golangci-lint-$(GOLANGCI_LINT_VERSION) diff --git a/copy_namedpipes_test.go b/copy_namedpipes_test.go index 716333a..e2d18a4 100644 --- a/copy_namedpipes_test.go +++ b/copy_namedpipes_test.go @@ -20,7 +20,7 @@ func TestCopyPipe_CouldNotMkdir(t *testing.T) { Return(errors.New("could not mkdir")) })(t) - err := copyPipe(fs, "/path/to/pipe", aferomock.NewFileInfo()) + err := copyPipe(fs, "/path/to/pipe", aferomock.NopFileInfo(t)) expectedErr := `could not mkdir` diff --git a/copy_namedpipes_x_test.go b/copy_namedpipes_x_test.go index 55ac7e2..3875c16 100644 --- a/copy_namedpipes_x_test.go +++ b/copy_namedpipes_x_test.go @@ -15,6 +15,6 @@ func TestCopyPipe_CouldNotMkdir(t *testing.T) { fs := aferomock.NoMockFs(t) - err := copyPipe(fs, "/path/to/pipe", aferomock.NewFileInfo()) + err := copyPipe(fs, "/path/to/pipe", aferomock.NopFileInfo(t)) assert.NoError(t, err) } diff --git a/copy_test.go b/copy_test.go index b008c1b..b25220e 100644 --- a/copy_test.go +++ b/copy_test.go @@ -170,7 +170,7 @@ func TestOptions_OnSymlink(t *testing.T) { } func TestOptions_Skip(t *testing.T) { - opt := Options{Skip: func(srcFs afero.Fs, src string) (bool, error) { + opt := Options{Skip: func(_ afero.Fs, src string) (bool, error) { switch { case strings.HasSuffix(src, "_skip"): return true, nil @@ -207,7 +207,7 @@ func TestOptions_Skip(t *testing.T) { t.Run("if Skip func returns error, Copy should be interrupted", func(t *testing.T) { errInsideSkipFunc := errors.New("something wrong inside Skip") - opt := Options{Skip: func(srcFs afero.Fs, src string) (bool, error) { + opt := Options{Skip: func(afero.Fs, string) (bool, error) { return false, errInsideSkipFunc }} err := Copy("resources/fixtures/data/case06", "resources/test/data.copy/case06.01", opt) @@ -285,7 +285,7 @@ func TestOptions_OnDirExists(t *testing.T) { t.Run("replace", func(t *testing.T) { opt := Options{ - OnDirExists: func(srcFs afero.Fs, src string, destFs afero.Fs, dest string) DirExistsAction { + OnDirExists: func(afero.Fs, string, afero.Fs, string) DirExistsAction { return Merge }, } @@ -307,7 +307,7 @@ func TestOptions_OnDirExists(t *testing.T) { t.Run("replace", func(t *testing.T) { opt := Options{ - OnDirExists: func(srcFs afero.Fs, src string, destFs afero.Fs, dest string) DirExistsAction { + OnDirExists: func(afero.Fs, string, afero.Fs, string) DirExistsAction { return Replace }, } @@ -328,7 +328,7 @@ func TestOptions_OnDirExists(t *testing.T) { t.Run("untouchable", func(t *testing.T) { opt := Options{ - OnDirExists: func(srcFs afero.Fs, src string, destFs afero.Fs, dest string) DirExistsAction { + OnDirExists: func(afero.Fs, string, afero.Fs, string) DirExistsAction { return Untouchable }, } @@ -342,7 +342,7 @@ func TestOptions_OnDirExists(t *testing.T) { t.Run("PreserveTimes is true with Untouchable", func(t *testing.T) { opt := Options{ - OnDirExists: func(srcFs afero.Fs, src string, destFs afero.Fs, dest string) DirExistsAction { + OnDirExists: func(afero.Fs, string, afero.Fs, string) DirExistsAction { return Untouchable }, PreserveTimes: true, diff --git a/example_test.go b/example_test.go index cf0ec25..bd66ea0 100644 --- a/example_test.go +++ b/example_test.go @@ -25,10 +25,10 @@ func ExampleOptions() { "resources/fixtures/data/example", "resources/test/data.copy/example_with_options", Options{ - Skip: func(srcFs afero.Fs, src string) (bool, error) { + Skip: func(_ afero.Fs, src string) (bool, error) { return strings.HasSuffix(src, ".git-like"), nil }, - OnSymlink: func(srcFs afero.Fs, src string) SymlinkAction { + OnSymlink: func(afero.Fs, string) SymlinkAction { return Skip }, PermissionControl: AddPermission(0o200), diff --git a/go.mod b/go.mod index 73fc86f..92887c3 100644 --- a/go.mod +++ b/go.mod @@ -5,17 +5,15 @@ go 1.17 require ( github.com/spf13/afero v1.11.0 github.com/stretchr/testify v1.9.0 - go.nhat.io/aferomock v0.4.0 + go.nhat.io/aferomock v0.6.0 ) require ( github.com/davecgh/go-spew v1.1.1 // indirect - github.com/kr/pretty v0.3.0 // indirect + github.com/kr/text v0.2.0 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect - github.com/rogpeppe/go-internal v1.9.0 // indirect github.com/stretchr/objx v0.5.2 // indirect - golang.org/x/text v0.14.0 // indirect - gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect + golang.org/x/text v0.18.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/go.sum b/go.sum index d0c6535..363b1e2 100644 --- a/go.sum +++ b/go.sum @@ -1354,8 +1354,9 @@ github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa02 github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= -github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0= github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk= +github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= +github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= @@ -1392,8 +1393,9 @@ github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec/go.mod h1:qq github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= -github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8= github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= +github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8= +github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4= github.com/ruudk/golang-pdf417 v0.0.0-20181029194003-1af4ab5afa58/go.mod h1:6lfFZQK844Gfx8o5WFuvpxWRwnSoipWe/p622j1v06w= github.com/ruudk/golang-pdf417 v0.0.0-20201230142125-a7e3863a1245/go.mod h1:pQAZKsJ8yyVxGRWYNEm9oFB8ieLgKFnamEyDmSA0BRk= github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= @@ -1429,8 +1431,8 @@ github.com/yuin/goldmark v1.4.1/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1 github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= github.com/zeebo/assert v1.3.0/go.mod h1:Pq9JiuJQpG8JLJdtkwrJESF0Foym2/D9XMU5ciN/wJ0= github.com/zeebo/xxh3 v1.0.2/go.mod h1:5NWz9Sef7zIDm2JHfFlcQvNekmcEl9ekUZQQKCYaDcA= -go.nhat.io/aferomock v0.4.0 h1:gs3nJzIqAezglUuaPfautAmZwulwRWLcfSSzdK4YCC0= -go.nhat.io/aferomock v0.4.0/go.mod h1:msi5MDOtJ/AroUa/lDc3jVGOILM4SKP//4yBRImOvkI= +go.nhat.io/aferomock v0.6.0 h1:LlGvABDSOs2pCdXweFIQ/tDF1oV0rWbr7Ih+N21EeQs= +go.nhat.io/aferomock v0.6.0/go.mod h1:DexRX1DiNRZwfGYrMdC5zjA09Mw95LrfYceLBlPZd5Y= go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= @@ -1462,6 +1464,8 @@ golang.org/x/crypto v0.13.0/go.mod h1:y6Z2r+Rw4iayiXXAIxJIDAJ1zMW4yaTpebo8fPOliY golang.org/x/crypto v0.14.0/go.mod h1:MVFd36DqK4CsrnJYDkBA3VC4m2GkXAM0PvzMCn4JQf4= golang.org/x/crypto v0.15.0/go.mod h1:4ChreQoLWfG3xLDer1WdlH5NdlQ3+mwnQq1YTKY+72g= golang.org/x/crypto v0.16.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4= +golang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDfU= +golang.org/x/crypto v0.23.0/go.mod h1:CKFgDieR+mRhux2Lsu27y0fO304Db0wZe70UKqHu0v8= golang.org/x/exp v0.0.0-20180321215751-8460e604b9de/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20180807140117-3d87b88a115f/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= @@ -1521,6 +1525,9 @@ golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/mod v0.9.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/mod v0.10.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/mod v0.11.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= +golang.org/x/mod v0.12.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= +golang.org/x/mod v0.15.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= +golang.org/x/mod v0.17.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -1584,10 +1591,13 @@ golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= golang.org/x/net v0.11.0/go.mod h1:2L/ixqYpgIVXmeoSA/4Lu7BzTG4KIyPIryS4IsOd1oQ= golang.org/x/net v0.12.0/go.mod h1:zEVYFnQC7m/vmpQFELhcD1EWkZlX69l4oqgmer6hfKA= golang.org/x/net v0.14.0/go.mod h1:PpSgVXXLK0OxS0F31C1/tv6XNguvCrnXIDrFMspZIUI= +golang.org/x/net v0.15.0/go.mod h1:idbUs1IY1+zTqbi8yxTbhexhEEk5ur9LInksu6HrEpk= golang.org/x/net v0.16.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE= golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE= golang.org/x/net v0.18.0/go.mod h1:/czyP5RqHAH4odGYxBJ1qz0+CE5WZ+2j1YgoEo8F2jQ= golang.org/x/net v0.19.0/go.mod h1:CfAk/cbD4CthTvqiEl8NpboMuiuOYsAr/7NOjZJtv1U= +golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44= +golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -1643,6 +1653,9 @@ golang.org/x/sync v0.2.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.3.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y= golang.org/x/sync v0.4.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y= golang.org/x/sync v0.5.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.8.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -1729,6 +1742,9 @@ golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.14.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/telemetry v0.0.0-20240228155512-f48c80bd79b2/go.mod h1:TeRTkGYfJXctD9OcfyVLyj2J3IxLnKwHJR8f4D8a3YE= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= @@ -1746,6 +1762,8 @@ golang.org/x/term v0.12.0/go.mod h1:owVbMEjm3cBLCHdkQu9b1opXd4ETQWc3BhuQGKgXgvU= golang.org/x/term v0.13.0/go.mod h1:LTmsnFJwVN6bCy1rVCoS+qHT1HhALEFxKncY3WNNh4U= golang.org/x/term v0.14.0/go.mod h1:TySc+nGkYR6qt8km8wUhuFRTVSMIX3XPR58y2lC8vww= golang.org/x/term v0.15.0/go.mod h1:BDl952bC7+uMoWR75FIrCDx79TPU9oHkTZ9yRbYOrX0= +golang.org/x/term v0.17.0/go.mod h1:lLRBjIVuehSbZlaOtGMbcMncT+aqLLLmKrsjNrUguwk= +golang.org/x/term v0.20.0/go.mod h1:8UkIAJTvZgivsXaD6/pH6U9ecQzZ45awqEOzuCvwpFY= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -1766,8 +1784,10 @@ golang.org/x/text v0.10.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= golang.org/x/text v0.11.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= golang.org/x/text v0.12.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= -golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= +golang.org/x/text v0.15.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= +golang.org/x/text v0.18.0 h1:XvMDiNzPAl0jr17s6W9lcaIhGUfUORdGCNsuLmPG224= +golang.org/x/text v0.18.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -1839,6 +1859,8 @@ golang.org/x/tools v0.7.0/go.mod h1:4pg6aUX35JBAogB10C9AtvVL+qowtN4pT3CGSQex14s= golang.org/x/tools v0.8.0/go.mod h1:JxBZ99ISMI5ViVkT1tr6tdNmXeTrcpVSD3vZ1RsRdN4= golang.org/x/tools v0.9.1/go.mod h1:owI94Op576fPu3cIGQeHs3joujW/2Oc6MtlxbF5dfNc= golang.org/x/tools v0.10.0/go.mod h1:UJwyiVBsOA2uwvK/e5OY3GTpDUJriEd+/YlqAwLPmyM= +golang.org/x/tools v0.13.0/go.mod h1:HvlwmtVNQAhOuCjW7xxvovg8wbNq7LwfXh/k7wXUl58= +golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d/go.mod h1:aiJjzUbINMkxbQROHiO6hDPo2LHcIPhhQsa9DLh0yGk= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= diff --git a/permission_control_test.go b/permission_control_test.go index c1eb573..12c5aa2 100644 --- a/permission_control_test.go +++ b/permission_control_test.go @@ -16,7 +16,7 @@ func TestPermissionControl_AddPermission_File(t *testing.T) { // Mocked file info and FS. srcInfo := aferomock.MockFileInfo(func(fileInfo *aferomock.FileInfo) { // Original permissions 0111 - fileInfo.On("Mode").Return(0o111) + fileInfo.On("Mode").Return(os.FileMode(0o111)) fileInfo.On("IsDir").Return(false) })(t) destFs := aferomock.MockFs(func(fs *aferomock.Fs) { @@ -39,7 +39,7 @@ func TestPermissionControl_AddPermission_Dir(t *testing.T) { // Mocked file info and FS. srcInfo := aferomock.MockFileInfo(func(fileInfo *aferomock.FileInfo) { // Original permissions 0111. - fileInfo.On("Mode").Return(0o111) + fileInfo.On("Mode").Return(os.FileMode(0o111)) fileInfo.On("IsDir").Return(true) })(t) destFs := aferomock.MockFs(func(fs *aferomock.Fs) { @@ -63,7 +63,7 @@ func TestPermissionControl_PreservePermission_File(t *testing.T) { // Mocked file info and FS. srcInfo := aferomock.MockFileInfo(func(fileInfo *aferomock.FileInfo) { // Original permissions 0123. - fileInfo.On("Mode").Return(0o123) + fileInfo.On("Mode").Return(os.FileMode(0o123)) fileInfo.On("IsDir").Return(false) })(t) destFs := aferomock.MockFs(func(fs *aferomock.Fs) { @@ -86,7 +86,7 @@ func TestPermissionControl_PreservePermission_Dir(t *testing.T) { // Mocked file info and FS. srcInfo := aferomock.MockFileInfo(func(fileInfo *aferomock.FileInfo) { // Original permissions 0123. - fileInfo.On("Mode").Return(0o123) + fileInfo.On("Mode").Return(os.FileMode(0o123)) fileInfo.On("IsDir").Return(true) })(t) destFs := aferomock.MockFs(func(fs *aferomock.Fs) { @@ -128,7 +128,7 @@ func TestPermissionControl_DoNothing_Dir(t *testing.T) { // Mocked file info and FS. srcInfo := aferomock.MockFileInfo(func(fileInfo *aferomock.FileInfo) { // Original permissions 0123. - fileInfo.On("Mode").Return(0o123) + fileInfo.On("Mode").Return(os.FileMode(0o123)) fileInfo.On("IsDir").Return(true) })(t) destFs := aferomock.MockFs(func(fs *aferomock.Fs) {