Commit Graph
2 Commits
Author SHA1 Message Date
Brad Fitzpatrick ba01cd8c93 all: fix problems found by running vet and staticcheck everywhere
These were hidden because golangci-lint only reported problems on
changed lines and vet never ran for windows or darwin. Among them, a
tsconnect build ignored precompression errors and two printf calls
formatted pointers with %d.

Fixing them first clears the way for an upcoming rework of vet in CI
that unifies our assorted static analysis checkers into one tool.

Fixes #22652
Updates #22653

Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
Change-Id: I89e8f5899a2fb9a2d477379e0c2c977d48e001a0
2026-12-02 02:45:54 -08:00
James Tucker 4f88a7ba46 tsweb/vcstime: add a VCS-time-stamped file system wrapper for embed.FS
embed.FS stores and serves no ModTime: files report a zero ModTime,
which disables HTTP caching semantics when served with net/http: no
Last-Modified header is sent and If-Modified-Since requests are never
answered with a 304.

vcstime.FS wraps an fs.FS (typically an embed.FS) and reports the
vcs.time commit time from the binary's build info as the modification
time of files that have no real timestamp of their own, enabling
http.FS to provide working cache headers for clean builds. Files that
already have a real timestamp are passed through untouched, and
binaries built without VCS stamping degrade to the file system's own
behavior.

Updates tailscale/corp#48172

Signed-off-by: James Tucker <james@tailscale.com>
2026-09-16 14:44:08 -07:00