summaryrefslogtreecommitdiff
path: root/internal/datafs
diff options
context:
space:
mode:
authordependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>2025-04-14 22:47:59 +0000
committerGitHub <noreply@github.com>2025-04-14 22:47:59 +0000
commit623a7d5952b77a76f4bf122f3e057fd2249bc99d (patch)
treebeed6ce566ae9e0725d99ac671c88bf5629a19b6 /internal/datafs
parent40eab0b7df39f7751578fc85e5cd133b86fb2812 (diff)
deps(actions): Bump golangci/golangci-lint-action from 6 to 7 (#2357)
* deps(actions): Bump golangci/golangci-lint-action from 6 to 7 Bumps [golangci/golangci-lint-action](https://github.com/golangci/golangci-lint-action) from 6 to 7. - [Release notes](https://github.com/golangci/golangci-lint-action/releases) - [Commits](https://github.com/golangci/golangci-lint-action/compare/v6...v7) --- updated-dependencies: - dependency-name: golangci/golangci-lint-action dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> * fix(lint): Fixing new lint errors Signed-off-by: Dave Henderson <dhenderson@gmail.com> --------- Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: Dave Henderson <dhenderson@gmail.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Dave Henderson <dhenderson@gmail.com>
Diffstat (limited to 'internal/datafs')
-rw-r--r--internal/datafs/fsys_test.go4
-rw-r--r--internal/datafs/getenv_test.go2
-rw-r--r--internal/datafs/mergefs.go2
-rw-r--r--internal/datafs/reader.go4
-rw-r--r--internal/datafs/reader_test.go2
-rw-r--r--internal/datafs/wdfs_test.go4
6 files changed, 9 insertions, 9 deletions
diff --git a/internal/datafs/fsys_test.go b/internal/datafs/fsys_test.go
index 14e2a0bd..b675c6a6 100644
--- a/internal/datafs/fsys_test.go
+++ b/internal/datafs/fsys_test.go
@@ -30,7 +30,7 @@ func TestFSysForPath(t *testing.T) {
fsp := fsimpl.FSProviderFunc(func(u *url.URL) (fs.FS, error) {
assert.Equal(t, "file", u.Scheme)
- if runtime.GOOS == "windows" {
+ if runtime.GOOS == osWindows {
assert.Equal(t, vol+"/tmp/foo/", u.Path)
return os.DirFS(vol + "/"), nil
}
@@ -61,7 +61,7 @@ func TestFSysForPath(t *testing.T) {
t.Run("git+file url", func(t *testing.T) {
fsp := fsimpl.FSProviderFunc(func(u *url.URL) (fs.FS, error) {
assert.Equal(t, "git+file", u.Scheme)
- if runtime.GOOS == "windows" {
+ if runtime.GOOS == osWindows {
assert.Equal(t, vol+"/tmp/repo/", u.Path)
} else {
assert.Equal(t, "/tmp/repo", u.Path)
diff --git a/internal/datafs/getenv_test.go b/internal/datafs/getenv_test.go
index c05a4c4b..8e5cc4df 100644
--- a/internal/datafs/getenv_test.go
+++ b/internal/datafs/getenv_test.go
@@ -46,7 +46,7 @@ func TestExpandEnvFsys(t *testing.T) {
fsys = writeOnly(fsys)
t.Setenv("FOO_FILE", "/tmp/unreadable")
- assert.Equal(t, "", ExpandEnvFsys(fsys, "${FOO}"))
+ assert.Empty(t, ExpandEnvFsys(fsys, "${FOO}"))
}
// Maybe extract this into a separate package sometime...
diff --git a/internal/datafs/mergefs.go b/internal/datafs/mergefs.go
index 4c10fb1d..ac5a5013 100644
--- a/internal/datafs/mergefs.go
+++ b/internal/datafs/mergefs.go
@@ -133,7 +133,7 @@ func (f *mergeFS) Open(name string) (fs.File, error) {
// need to support absolute paths on local filesystem too
// TODO: this is a hack, probably fix this?
- if fsURL.Scheme == "file" && runtime.GOOS != "windows" {
+ if fsURL.Scheme == "file" && runtime.GOOS != osWindows {
base = fsURL.Path + base
}
diff --git a/internal/datafs/reader.go b/internal/datafs/reader.go
index 298fd9da..0297ac69 100644
--- a/internal/datafs/reader.go
+++ b/internal/datafs/reader.go
@@ -18,6 +18,8 @@ import (
"github.com/hairyhenderson/gomplate/v4/internal/iohelpers"
)
+const osWindows = "windows"
+
// typeOverrideParam gets the query parameter used to override the content type
// used to parse a given datasource - use GOMPLATE_TYPE_PARAM to use a different
// parameter name.
@@ -132,7 +134,7 @@ func (d *dsReader) readFileContent(ctx context.Context, u *url.URL, hdr http.Hea
// need to support absolute paths on local filesystem too
// TODO: this is a hack, probably fix this?
- if u.Scheme == "file" && runtime.GOOS != "windows" {
+ if u.Scheme == "file" && runtime.GOOS != osWindows {
fname = u.Path + fname
}
diff --git a/internal/datafs/reader_test.go b/internal/datafs/reader_test.go
index dbb37edc..a89656a7 100644
--- a/internal/datafs/reader_test.go
+++ b/internal/datafs/reader_test.go
@@ -19,8 +19,6 @@ import (
"github.com/stretchr/testify/require"
)
-const osWindows = "windows"
-
func TestResolveURL(t *testing.T) {
out, err := resolveURL(*mustParseURL("http://example.com/foo.json"), "bar.json")
require.NoError(t, err)
diff --git a/internal/datafs/wdfs_test.go b/internal/datafs/wdfs_test.go
index 30fd5cf0..571f1e83 100644
--- a/internal/datafs/wdfs_test.go
+++ b/internal/datafs/wdfs_test.go
@@ -158,14 +158,14 @@ func TestWDFS_WriteOps(t *testing.T) {
func skipWindows(t *testing.T) {
t.Helper()
- if runtime.GOOS == "windows" {
+ if runtime.GOOS == osWindows {
t.Skip("skipping non-Windows test")
}
}
func skipNonWindows(t *testing.T) {
t.Helper()
- if runtime.GOOS != "windows" {
+ if runtime.GOOS != osWindows {
t.Skip("skipping Windows test")
}
}