diff options
| author | Stefan Majewsky <majewsky@gmx.net> | 2026-05-03 20:41:58 +0200 |
|---|---|---|
| committer | Stefan Majewsky <majewsky@gmx.net> | 2026-05-03 20:41:58 +0200 |
| commit | c808a35d7b56319d8fa4b21516b328a0513f5949 (patch) | |
| tree | 66eaca8be93821e874cadc353ff84926dc71fcfb /assetembed | |
| parent | 80e08e6aee59ef32355fe5a376f295f1fd7dec1c (diff) | |
| download | go-gg-c808a35d7b56319d8fa4b21516b328a0513f5949.tar.gz | |
adjust docstrings to use link syntax where possible, add refs to new YAML library module path
Diffstat (limited to 'assetembed')
| -rw-r--r-- | assetembed/assetembed.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/assetembed/assetembed.go b/assetembed/assetembed.go index f8dcaf8..fc25f11 100644 --- a/assetembed/assetembed.go +++ b/assetembed/assetembed.go @@ -2,7 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 // Package assetembed provides a HTTP handler for serving asset files embedded in a Go binary through the embed.FS type. -// It is similar in purpose to http.FileServerFS() from the standard library, +// It is similar in purpose to [http.FileServerFS] from the standard library, // but instead of serving files directly with their names as found in the filesystem, // it inserts a cryptographic digest of the file contents into the filename that the handler serves. // @@ -34,7 +34,7 @@ type Handler struct { contents map[string][]byte // e.g. "res/app-e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855.css" -> [contents of res/app.css] } -// NewHandler builds a new Handler instance. +// NewHandler builds a new [Handler] instance. // This will read all files in assetFS and store a copy of their contents inside the Handler instance. // // For filesystems backed by actual disk or network storage, this can be a very expensive operation. @@ -120,7 +120,7 @@ var cacheControlHeader = fmt.Sprintf( int64((14 * 24 * time.Hour).Seconds()), // max-age = 2 weeks ) -// ServeHTTP implements the http.Handler interface. +// ServeHTTP implements the [http.Handler] interface. func (h *Handler) ServeHTTP(w http.ResponseWriter, r *http.Request) { buf, exists := h.contents[strings.TrimPrefix(r.URL.Path, "/")] if !exists { |
