commit 3b4821d79893d224c913cde00ad30af47ed11431
parent 0c0aad7db9158bdb75e4d2f22297746205abda52
Author: Jack Mordaunt <jackmordaunt.dev@gmail.com>
Date: Wed, 16 Sep 2026 21:44:43 -0400
cmd/icnsify: use the os package instead of afero
afero was only ever used with the real filesystem, yet it pulls Google Cloud
Storage, gRPC and protobuf into the module graph. Removing it is a
precondition for folding the CLI into the library module without burdening
every library consumer with those dependencies.
Diffstat:
2 files changed, 3 insertions(+), 8 deletions(-)
diff --git a/cmd/icnsify/go.mod b/cmd/icnsify/go.mod
@@ -4,11 +4,9 @@ go 1.21.5
require (
github.com/jackmordaunt/icns/v4 v4.0.0
- github.com/spf13/afero v1.11.0
github.com/spf13/pflag v1.0.5
)
require (
github.com/nfnt/resize v0.0.0-20180221191011-83c6a9932646 // indirect
- golang.org/x/text v0.19.0 // indirect
)
diff --git a/cmd/icnsify/main.go b/cmd/icnsify/main.go
@@ -14,13 +14,10 @@ import (
"strings"
"github.com/jackmordaunt/icns/v4"
- "github.com/spf13/afero"
"github.com/spf13/pflag"
)
-var fs = afero.NewOsFs()
-
// errUsage signals that no work was requested; usage has been printed.
var errUsage = errors.New("usage")
@@ -77,16 +74,16 @@ func run() error {
usage()
return errUsage
}
- sourcef, err := fs.Open(in)
+ sourcef, err := os.Open(in)
if err != nil {
return fmt.Errorf("opening source image: %w", err)
}
defer sourcef.Close()
input = sourcef
- if err := fs.MkdirAll(filepath.Dir(out), 0o755); err != nil {
+ if err := os.MkdirAll(filepath.Dir(out), 0o755); err != nil {
return fmt.Errorf("preparing output directory: %w", err)
}
- outputf, err := fs.Create(out)
+ outputf, err := os.Create(out)
if err != nil {
return fmt.Errorf("creating output file: %w", err)
}