Help us shape the future of Go! Take the 2026 Go Developer Survey

file

package
v1.20.0-alpha.1 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ClientOriginalExtension

func ClientOriginalExtension(file string) string

func Contain

func Contain(file string, search string) bool

DEPRECATED: Use Contains instead

func Contains

func Contains(file string, search string) bool

func Copy

func Copy(src, dst string) error

func Create

func Create(file string, content string) error

Create a file with the given content Deprecated: Use PutContent instead

func Exists

func Exists(file string) bool

func Extension

func Extension(file string, originalWhenUnknown ...bool) (string, error)

Extension Supported types: https://github.com/gabriel-vasile/mimetype/blob/master/supported_mimes.md

func GetContent

func GetContent(file string) (string, error)

func GetFrameworkContent

func GetFrameworkContent(file string) (string, error)

func GetPackageContent

func GetPackageContent(pkgName, file string) (string, error)

func LastModified

func LastModified(file, timezone string) (time.Time, error)

func MimeType

func MimeType(file string) (string, error)

func PutContent

func PutContent(file string, content string, options ...Option) error

func Remove

func Remove(file string) error

func Size

func Size(file string) (int64, error)

Types

type Option

type Option func(*option)

Option represents an option for FilePutContents

func WithAppend

func WithAppend() Option

WithAppend sets the append mode for FilePutContents

func WithMode

func WithMode(mode os.FileMode) Option

WithMode sets the file mode for FilePutContents

Jump to

Keyboard shortcuts

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