update proxy server

This commit is contained in:
Mike Danese
2016-01-05 17:58:51 -08:00
parent 60c5db5e87
commit 309eac5f7f
6 changed files with 128 additions and 54 deletions

View File

@@ -238,3 +238,18 @@ func ReadDirNoExit(dirname string) ([]os.FileInfo, []error, error) {
return list, errs, nil
}
// IntPtr returns a pointer to an int
func IntPtr(i int) *int {
o := i
return &o
}
// IntPtrDerefOr derefrence the int ptr and returns it i not nil,
// else returns def.
func IntPtrDerefOr(ptr *int, def int) int {
if ptr != nil {
return *ptr
}
return def
}