@@ -14,9 +14,9 @@ import (
1414
1515const defaultFileMode = 0644
1616
17- // PathOp is a function which accepts a Path and performs an operation on that
18- // path. When called with real filesystem objects (File or Dir) a PathOp modifies
19- // the filesystem at the path. When used with a Manifest object a PathOp updates
17+ // PathOp is a function which accepts a [ Path] and performs an operation on that
18+ // path. When called with real filesystem objects ([ File] or [ Dir] ) a PathOp modifies
19+ // the filesystem at the path. When used with a [ Manifest] object a PathOp updates
2020// the manifest to expect a value.
2121type PathOp func (path Path ) error
2222
@@ -38,7 +38,7 @@ type manifestDirectory interface {
3838 AddDirectory (path string , ops ... PathOp ) error
3939}
4040
41- // WithContent writes content to a file at Path
41+ // WithContent writes content to a file at [ Path]
4242func WithContent (content string ) PathOp {
4343 return func (path Path ) error {
4444 if m , ok := path .(manifestFile ); ok {
@@ -49,7 +49,7 @@ func WithContent(content string) PathOp {
4949 }
5050}
5151
52- // WithBytes write bytes to a file at Path
52+ // WithBytes write bytes to a file at [ Path]
5353func WithBytes (raw []byte ) PathOp {
5454 return func (path Path ) error {
5555 if m , ok := path .(manifestFile ); ok {
@@ -60,7 +60,7 @@ func WithBytes(raw []byte) PathOp {
6060 }
6161}
6262
63- // WithReaderContent copies the reader contents to the file at Path
63+ // WithReaderContent copies the reader contents to the file at [ Path]
6464func WithReaderContent (r io.Reader ) PathOp {
6565 return func (path Path ) error {
6666 if m , ok := path .(manifestFile ); ok {
@@ -77,7 +77,7 @@ func WithReaderContent(r io.Reader) PathOp {
7777 }
7878}
7979
80- // AsUser changes ownership of the file system object at Path
80+ // AsUser changes ownership of the file system object at [ Path]
8181func AsUser (uid , gid int ) PathOp {
8282 return func (path Path ) error {
8383 if m , ok := path .(manifestResource ); ok {
@@ -132,7 +132,7 @@ func WithFiles(files map[string]string) PathOp {
132132 }
133133}
134134
135- // FromDir copies the directory tree from the source path into the new Dir
135+ // FromDir copies the directory tree from the source path into the new [ Dir]
136136func FromDir (source string ) PathOp {
137137 return func (path Path ) error {
138138 if _ , ok := path .(manifestDirectory ); ok {
@@ -142,7 +142,7 @@ func FromDir(source string) PathOp {
142142 }
143143}
144144
145- // WithDir creates a subdirectory in the directory at path. Additional PathOp
145+ // WithDir creates a subdirectory in the directory at path. Additional [ PathOp]
146146// can be used to modify the subdirectory
147147func WithDir (name string , ops ... PathOp ) PathOp {
148148 const defaultMode = 0755
@@ -161,7 +161,7 @@ func WithDir(name string, ops ...PathOp) PathOp {
161161 }
162162}
163163
164- // Apply the PathOps to the File
164+ // Apply the PathOps to the [ File]
165165func Apply (t assert.TestingT , path Path , ops ... PathOp ) {
166166 if ht , ok := t .(helperT ); ok {
167167 ht .Helper ()
@@ -178,7 +178,7 @@ func applyPathOps(path Path, ops []PathOp) error {
178178 return nil
179179}
180180
181- // WithMode sets the file mode on the directory or file at path
181+ // WithMode sets the file mode on the directory or file at [Path]
182182func WithMode (mode os.FileMode ) PathOp {
183183 return func (path Path ) error {
184184 if m , ok := path .(manifestResource ); ok {
@@ -241,7 +241,7 @@ func copyFile(source, dest string) error {
241241// WithSymlink creates a symlink in the directory which links to target.
242242// Target must be a path relative to the directory.
243243//
244- // Note: the argument order is the inverse of os.Symlink to be consistent with
244+ // Note: the argument order is the inverse of [ os.Symlink] to be consistent with
245245// the other functions in this package.
246246func WithSymlink (path , target string ) PathOp {
247247 return func (root Path ) error {
@@ -255,7 +255,7 @@ func WithSymlink(path, target string) PathOp {
255255// WithHardlink creates a link in the directory which links to target.
256256// Target must be a path relative to the directory.
257257//
258- // Note: the argument order is the inverse of os.Link to be consistent with
258+ // Note: the argument order is the inverse of [ os.Link] to be consistent with
259259// the other functions in this package.
260260func WithHardlink (path , target string ) PathOp {
261261 return func (root Path ) error {
0 commit comments