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

files

package
v0.1.56 Latest Latest
Warning

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

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

Documentation

Overview

Package files keeps one mod's files as modlock-host does: the files the mod wrote, in a directory of its own, over the files its build ships in data/.

Index

Constants

View Source
const Quota = 4 << 20

Quota bounds the bytes one mod's written files hold together.

Variables

This section is empty.

Functions

This section is empty.

Types

type Mod

type Mod struct {
	// Written is the directory that keeps the files the mod writes, or empty
	// to refuse its writes.
	Written string
	// Data holds the files the build ships, or is nil for none.
	Data fs.FS
}

Mod is one mod's files.

func (*Mod) Read

func (m *Mod) Read(name string) (string, bool, error)

Read returns the text of the file name, from the written files when they hold one and from the build's otherwise, and false when neither does.

func (*Mod) Write

func (m *Mod) Write(name, text string) error

Write replaces the file name in the written files with text, whole or not at all, while they stay within Quota.

Jump to

Keyboard shortcuts

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