assets

package
v0.0.36 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2026 License: MIT Imports: 5 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ETags = func() map[string]string {
	m := map[string]string{}
	entries, err := assets.ReadDir(".")
	if err != nil {
		return m
	}
	for _, e := range entries {
		data, err := fs.ReadFile(assets, e.Name())
		if err != nil {
			continue
		}
		sum := sha256.Sum256(data)
		m[e.Name()] = `"` + hex.EncodeToString(sum[:8]) + `"`
	}
	return m
}()

ETags maps each embedded asset to a strong validator. Assets are served with Cache-Control: no-cache so an upgraded binary is never stale; the validator makes that policy cost a 304 instead of a refetch (the font alone is ~900KB, downloaded on every page load otherwise).

View Source
var FS = http.FS(assets)

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

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