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).

mksysnum_plan9.sh 459B

1234567891011121314151617181920212223
  1. #!/bin/sh
  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. COMMAND="mksysnum_plan9.sh $@"
  6. cat <<EOF
  7. // $COMMAND
  8. // MACHINE GENERATED BY THE ABOVE COMMAND; DO NOT EDIT
  9. package plan9
  10. const(
  11. EOF
  12. SP='[ ]' # space or tab
  13. sed "s/^#define${SP}\\([A-Z0-9_][A-Z0-9_]*\\)${SP}${SP}*\\([0-9][0-9]*\\)/SYS_\\1=\\2/g" \
  14. < $1 | grep -v SYS__
  15. cat <<EOF
  16. )
  17. EOF