MCPcopy Create free account
hub / github.com/tailscale/tailscale / writeFile

Method writeFile

drive/driveimpl/drive_test.go:579–587  ·  view source on GitHub ↗
(label, remoteName, shareName, name, contents string, expectSuccess bool)

Source from the content-addressed store, hash-verified

577}
578
579func (s *system) writeFile(label, remoteName, shareName, name, contents string, expectSuccess bool) {
580 path := pathTo(remoteName, shareName, name)
581 err := s.client.Write(path, []byte(contents), 0644)
582 if expectSuccess && err != nil {
583 s.t.Fatalf("%v: expected success writing file %q, but got error %v", label, path, err)
584 } else if !expectSuccess && err == nil {
585 s.t.Fatalf("%v: expected error writing file %q, but got no error", label, path)
586 }
587}
588
589func (s *system) renameFile(label, remoteName, fromShare, fromFile, toShare, toFile string, expectSuccess bool) {
590 fromPath := pathTo(remoteName, fromShare, fromFile)

Callers 6

TestDirectoryListingFunction · 0.80
TestFileManipulationFunction · 0.80
TestPermissionsFunction · 0.80
TestSecretTokenAuthFunction · 0.80
TestLOCKFunction · 0.80
TestUNLOCKFunction · 0.80

Calls 3

pathToFunction · 0.85
WriteMethod · 0.65
FatalfMethod · 0.65

Tested by

no test coverage detected