Skip to content

Commit

Permalink
Replace the gofs package with the nsgo package (#25)
Browse files Browse the repository at this point in the history
  • Loading branch information
mstmdev authored Nov 3, 2023
1 parent c50aa03 commit 803e587
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 24 deletions.
2 changes: 1 addition & 1 deletion command/hash.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package command

import (
"github.com/no-src/gofs/util/hashutil"
"github.com/no-src/nsgo/hashutil"
)

type hash struct {
Expand Down
4 changes: 2 additions & 2 deletions command/is_dir.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package command

import (
"github.com/no-src/gofs/fs"
"github.com/no-src/nsgo/fsutil"
)

type isDir struct {
Expand All @@ -10,7 +10,7 @@ type isDir struct {
}

func (c isDir) Exec() error {
dir, err := fs.IsDir(c.Source)
dir, err := fsutil.IsDir(c.Source)
if err != nil {
return err
}
Expand Down
2 changes: 1 addition & 1 deletion command/is_equal.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package command
import (
"os"

"github.com/no-src/gofs/util/hashutil"
"github.com/no-src/nsgo/hashutil"
)

type isEqual struct {
Expand Down
4 changes: 2 additions & 2 deletions command/is_exist.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package command

import (
"github.com/no-src/gofs/fs"
"github.com/no-src/nsgo/fsutil"
)

type isExist struct {
Expand All @@ -10,7 +10,7 @@ type isExist struct {
}

func (c isExist) Exec() error {
exist, err := fs.FileExist(c.Source)
exist, err := fsutil.FileExist(c.Source)
if err == nil && exist != c.Expect {
err = newNotExpectedError(c, exist)
}
Expand Down
4 changes: 2 additions & 2 deletions command/is_symlink.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package command

import (
"github.com/no-src/gofs/fs"
"github.com/no-src/nsgo/fsutil"
)

type isSymlink struct {
Expand All @@ -11,7 +11,7 @@ type isSymlink struct {
}

func (c isSymlink) Exec() error {
actual, err := fs.IsSymlink(c.Link)
actual, err := fsutil.IsSymlink(c.Link)
if err != nil {
if c.IgnoreError {
return nil
Expand Down
4 changes: 2 additions & 2 deletions command/touch.go
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
package command

import (
"github.com/no-src/gofs/fs"
"github.com/no-src/nsgo/fsutil"
)

type touch struct {
Source string `yaml:"source"`
}

func (c touch) Exec() error {
f, err := fs.CreateFile(c.Source)
f, err := fsutil.CreateFile(c.Source)
if err != nil {
return err
}
Expand Down
6 changes: 3 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ module github.com/no-src/fsctl
go 1.20

require (
github.com/no-src/gofs v0.8.0
github.com/no-src/log v0.3.1
github.com/no-src/nsgo v0.0.0-20231103152835-167bae0e1fb2
gopkg.in/yaml.v3 v3.0.1
)

require (
github.com/kr/pretty v0.3.0 // indirect
github.com/rogpeppe/go-internal v1.8.0 // indirect
github.com/kr/text v0.2.0 // indirect
github.com/rogpeppe/go-internal v1.9.0 // indirect
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect
)
16 changes: 5 additions & 11 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,24 +1,18 @@
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
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/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=
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
github.com/no-src/gofs v0.8.0 h1:MQ4+u/s0k+8UYyAjMNFSYDT67nOuRNli/D0kVbu5a84=
github.com/no-src/gofs v0.8.0/go.mod h1:VRrcok5PjfZDM1TpNLTrYTREGc6uNiYQz5artcl24q4=
github.com/no-src/log v0.3.1 h1:HvozFJQwRicaCThaRztVNOACR01jMiK8Upn4eU7lyps=
github.com/no-src/log v0.3.1/go.mod h1:AG2AiKsnJpZQHmJ24waj6Bi0xHaBEPXiFl1yYpHzLJQ=
github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA=
github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc=
github.com/rogpeppe/go-internal v1.8.0 h1:FCbCCtXNOY3UtUuHUYaghJg4y7Fd14rXifAYUAtL9R8=
github.com/rogpeppe/go-internal v1.8.0/go.mod h1:WmiCO8CzOY8rg0OYDC4/i/2WRWAB6poM+XZ2dLUbcbE=
github.com/no-src/nsgo v0.0.0-20231103152835-167bae0e1fb2 h1:D6T1flNPHi9iloP/vrCI2qbA8HaWil6otgLETOieJPU=
github.com/no-src/nsgo v0.0.0-20231103152835-167bae0e1fb2/go.mod h1:NPhBsJE4Us7xqR6yJh5zUGdx4cELBfAAZDnz5HP9Bqw=
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=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=

0 comments on commit 803e587

Please sign in to comment.