github.com/rakyll/go@v0.0.0-20170216000551-64c02460d703/src/run.bash (about)

     1  #!/usr/bin/env bash
     2  # Copyright 2009 The Go Authors. All rights reserved.
     3  # Use of this source code is governed by a BSD-style
     4  # license that can be found in the LICENSE file.
     5  
     6  set -e
     7  
     8  eval $(go env)
     9  export GOROOT   # the api test requires GOROOT to be set.
    10  
    11  unset CDPATH	# in case user has it set
    12  unset GOPATH    # we disallow local import for non-local packages, if $GOROOT happens
    13                  # to be under $GOPATH, then some tests below will fail
    14  unset GOBIN     # Issue 14340
    15  
    16  export GOHOSTOS
    17  export CC
    18  
    19  # no core files, please
    20  ulimit -c 0
    21  
    22  # Raise soft limits to hard limits for NetBSD/OpenBSD.
    23  # We need at least 256 files and ~300 MB of bss.
    24  # On OS X ulimit -S -n rejects 'unlimited'.
    25  #
    26  # Note that ulimit -S -n may fail if ulimit -H -n is set higher than a
    27  # non-root process is allowed to set the high limit.
    28  # This is a system misconfiguration and should be fixed on the
    29  # broken system, not "fixed" by ignoring the failure here.
    30  # See longer discussion on golang.org/issue/7381. 
    31  [ "$(ulimit -H -n)" == "unlimited" ] || ulimit -S -n $(ulimit -H -n)
    32  [ "$(ulimit -H -d)" == "unlimited" ] || ulimit -S -d $(ulimit -H -d)
    33  
    34  # Thread count limit on NetBSD 7.
    35  if ulimit -T &> /dev/null; then
    36  	[ "$(ulimit -H -T)" == "unlimited" ] || ulimit -S -T $(ulimit -H -T)
    37  fi
    38  
    39  exec go tool dist test -rebuild "$@"