files

package
v5.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 12, 2025 License: MIT Imports: 4 Imported by: 0

README

== File utils

* link:files.go[] - Reads the contents of a file and checks that there was no error while reading.

OS file system (link:files_test.go[]):

[source,go]
----
include::files_test.go[tag=snippet]
include::files_test.go[tag=snippet_os]
include::files_test.go[tag=snippet_reader_os]
----

For any `fs.FS` implementation, for example - Embedded FS (link:files_test.go[]):

[source,go]
----
include::files_test.go[tag=snippet]
include::files_test.go[tag=snippet_embedded]
include::files_test.go[tag=snippet_reader_embedded]
----

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Close

func Close(closer io.Closer)

func FileReader

func FileReader(fs vfs.Opener, filePath string) vfs.ReadSeekCloser

func ReadFile

func ReadFile(fs vfs.Opener, filePath string) []byte

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL