From 7cb276660296a8f55166607c7deeaf8538755494 Mon Sep 17 00:00:00 2001 From: Yixin Wei Date: Fri, 23 Oct 2026 11:34:38 -0700 Subject: [PATCH] Fix GitHub lint: discard Munmap's error explicitly in data_read (#589) Summary: facebook/time's GitHub lint job fails on the exported D124865748: fbclock/data_read.go:122:19: Error return value of `unix.Munmap` is not checked (errcheck) The deferred Munmap only drops a read-only mapping after the snapshot is copied, so there's nothing to do with its error. This discards it explicitly, as shmem_notlinux.go's deferred Munmaps do. Internal lint doesn't report it: arc lint, extra linters included, passes on the unchanged line. Differential Revision: D127204480 --- fbclock/data_read.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fbclock/data_read.go b/fbclock/data_read.go index 62d3ce77..25d1e728 100644 --- a/fbclock/data_read.go +++ b/fbclock/data_read.go @@ -119,7 +119,7 @@ func ReadFBClockDataFile(path string, v2 bool) (*DataFileSnapshot, error) { if err != nil { return nil, err } - defer unix.Munmap(mapping) + defer func() { _ = unix.Munmap(mapping) }() view := &DataFileSnapshot{Path: path, Version: version, Size: info.Size()} if v2 { for index, name := range []string{"primary", "realtime"} {