From 68cf18548ebdbe2964ebfe414b7ac0c52910f4be Mon Sep 17 00:00:00 2001 From: Michael Matloob Date: Thu, 11 Aug 2016 00:12:21 -0400 Subject: [PATCH] x/tools/cmd/heapview/internal/core: stub mmapfile for !darwin,!linux mmapfile.go uses symbols in the syscall package that are not defined on windows and some other operating systems. Temporarily buildtag-restrict mmapfile to darwin and linux (the platforms easiest for me to test) to fix the build. Change-Id: Ib056608a655b6d32170cd86deac785811e7bc0d1 Reviewed-on: https://go-review.googlesource.com/26830 Reviewed-by: Brad Fitzpatrick --- cmd/heapview/internal/core/mmapfile.go | 2 ++ cmd/heapview/internal/core/mmapfile_other.go | 14 ++++++++++++++ 2 files changed, 16 insertions(+) create mode 100644 cmd/heapview/internal/core/mmapfile_other.go diff --git a/cmd/heapview/internal/core/mmapfile.go b/cmd/heapview/internal/core/mmapfile.go index 9886d357..78445a9c 100644 --- a/cmd/heapview/internal/core/mmapfile.go +++ b/cmd/heapview/internal/core/mmapfile.go @@ -2,6 +2,8 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +// +build darwin linux + package core import ( diff --git a/cmd/heapview/internal/core/mmapfile_other.go b/cmd/heapview/internal/core/mmapfile_other.go new file mode 100644 index 00000000..181f8420 --- /dev/null +++ b/cmd/heapview/internal/core/mmapfile_other.go @@ -0,0 +1,14 @@ +// Copyright 2016 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build !darwin,!linux + +package core + +// TODO(matloob): perhaps use the more portable golang.org/x/exp/mmap +// instead of the mmap code in mmapfile.go. + +type mmapFile struct{} + +func (m *mmapFile) Close() error { return nil }