Skip to content

Commit d025392

Browse files
committed
fix: unexport HTTPNode.url
1 parent d47bad9 commit d025392

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

taskfile/node_http.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import (
1717
// An HTTPNode is a node that reads a Taskfile from a remote location via HTTP.
1818
type HTTPNode struct {
1919
*baseNode
20-
URL *url.URL // stores url pointing actual remote file. (e.g. with Taskfile.yml)
20+
url *url.URL // stores url pointing actual remote file. (e.g. with Taskfile.yml)
2121
}
2222

2323
func NewHTTPNode(
@@ -36,20 +36,20 @@ func NewHTTPNode(
3636
}
3737
return &HTTPNode{
3838
baseNode: base,
39-
URL: url,
39+
url: url,
4040
}, nil
4141
}
4242

4343
func (node *HTTPNode) Location() string {
44-
return node.URL.Redacted()
44+
return node.url.Redacted()
4545
}
4646

4747
func (node *HTTPNode) Read() ([]byte, error) {
4848
return node.ReadContext(context.Background())
4949
}
5050

5151
func (node *HTTPNode) ReadContext(ctx context.Context) ([]byte, error) {
52-
url, err := RemoteExists(ctx, *node.URL)
52+
url, err := RemoteExists(ctx, *node.url)
5353
if err != nil {
5454
return nil, err
5555
}
@@ -87,7 +87,7 @@ func (node *HTTPNode) ResolveEntrypoint(entrypoint string) (string, error) {
8787
if err != nil {
8888
return "", err
8989
}
90-
return node.URL.ResolveReference(ref).String(), nil
90+
return node.url.ResolveReference(ref).String(), nil
9191
}
9292

9393
func (node *HTTPNode) ResolveDir(dir string) (string, error) {
@@ -112,12 +112,12 @@ func (node *HTTPNode) ResolveDir(dir string) (string, error) {
112112

113113
func (node *HTTPNode) CacheKey() string {
114114
checksum := strings.TrimRight(checksum([]byte(node.Location())), "=")
115-
dir, filename := filepath.Split(node.URL.Path)
115+
dir, filename := filepath.Split(node.url.Path)
116116
lastDir := filepath.Base(dir)
117117
prefix := filename
118118
// Means it's not "", nor "." nor "/", so it's a valid directory
119119
if len(lastDir) > 1 {
120120
prefix = fmt.Sprintf("%s.%s", lastDir, filename)
121121
}
122-
return fmt.Sprintf("http.%s.%s.%s", node.URL.Host, prefix, checksum)
122+
return fmt.Sprintf("http.%s.%s.%s", node.url.Host, prefix, checksum)
123123
}

0 commit comments

Comments
 (0)