MCPcopy Create free account
hub / github.com/hpcloud/tail / AppendFile

Method AppendFile

tail_test.go:445–455  ·  view source on GitHub ↗
(name string, contents string)

Source from the content-addressed store, hash-verified

443}
444
445func (t TailTest) AppendFile(name string, contents string) {
446 f, err := os.OpenFile(t.path+"/"+name, os.O_APPEND|os.O_WRONLY, 0600)
447 if err != nil {
448 t.Fatal(err)
449 }
450 defer f.Close()
451 _, err = f.WriteString(contents)
452 if err != nil {
453 t.Fatal(err)
454 }
455}
456
457func (t TailTest) TruncateFile(name string, contents string) {
458 f, err := os.OpenFile(t.path+"/"+name, os.O_TRUNC|os.O_WRONLY, 0600)

Callers 4

TestLocationEndFunction · 0.95
TestLocationMiddleFunction · 0.95
TestRateLimitingFunction · 0.95

Calls 1

FatalMethod · 0.80

Tested by

no test coverage detected