getPackage returns the name of the current package, which makes running this test in a fork simpler
()
| 106 | // getPackage returns the name of the current package, which makes running this |
| 107 | // test in a fork simpler |
| 108 | func getPackage() []byte { |
| 109 | pc, _, _, _ := runtime.Caller(0) |
| 110 | fullFuncName := runtime.FuncForPC(pc).Name() |
| 111 | idx := strings.LastIndex(fullFuncName, ".") |
| 112 | return []byte(fullFuncName[:idx]) // trim off function details |
| 113 | } |
| 114 | |
| 115 | var testprogleader = []byte(` |
| 116 | // Test program for atexit, gets output file and data as arguments and writes |