A lightweight mechanism to provide an *instant kickstart* to a Go web server instance upon changing any Go source files under the project directory (and its subdirectories).

mmap_unix_test.go 542B

1234567891011121314151617181920212223
  1. // Copyright 2014 The Go Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style
  3. // license that can be found in the LICENSE file.
  4. // +build darwin dragonfly freebsd linux netbsd openbsd solaris
  5. package unix_test
  6. import (
  7. "testing"
  8. "golang.org/x/sys/unix"
  9. )
  10. func TestMmap(t *testing.T) {
  11. b, err := unix.Mmap(-1, 0, unix.Getpagesize(), unix.PROT_NONE, unix.MAP_ANON|unix.MAP_PRIVATE)
  12. if err != nil {
  13. t.Fatalf("Mmap: %v", err)
  14. }
  15. if err := unix.Munmap(b); err != nil {
  16. t.Fatalf("Munmap: %v", err)
  17. }
  18. }