github.com/telepresenceio/telepresence/v2@v2.20.0-pro.6.0.20240517030216-236ea954e789/pkg/dos/package.go (about)

     1  // Package dos contains an abstraction of some functions in the go os package. When used in code, it allows those
     2  // functions to be mocked in unit tests.
     3  // In general, the functions are implemented using an interface which is then stored in the context. The functions
     4  // are then called using dos instead of os, and with an additional first context argument. E.g.
     5  //
     6  //	ctx := dos.WithFS(ctx, mockFS)
     7  //	f, err := dos.Open(ctx, "/etc/resolv.conf")
     8  package dos