MCPcopy Index your code
hub / github.com/devspace-sh/devspace / fillGo18FileTypeBits

Function fillGo18FileTypeBits

pkg/devspace/sync/tar.go:372–393  ·  view source on GitHub ↗

fillGo18FileTypeBits fills type bits which have been removed on Go 1.9 archive/tar https://github.com/golang/go/commit/66b5a2f

(mode int64, fi os.FileInfo)

Source from the content-addressed store, hash-verified

370// fillGo18FileTypeBits fills type bits which have been removed on Go 1.9 archive/tar
371// https://github.com/golang/go/commit/66b5a2f
372func fillGo18FileTypeBits(mode int64, fi os.FileInfo) int64 {
373 fm := fi.Mode()
374 switch {
375 case fm.IsRegular():
376 mode |= modeISREG
377 case fi.IsDir():
378 mode |= modeISDIR
379 case fm&os.ModeSymlink != 0:
380 mode |= modeISLNK
381 case fm&os.ModeDevice != 0:
382 if fm&os.ModeCharDevice != 0 {
383 mode |= modeISCHR
384 } else {
385 mode |= modeISBLK
386 }
387 case fm&os.ModeNamedPipe != 0:
388 mode |= modeISFIFO
389 case fm&os.ModeSocket != 0:
390 mode |= modeISSOCK
391 }
392 return mode
393}
394
395func createFileInformationFromStat(relativePath string, stat os.FileInfo) *FileInformation {
396 return &FileInformation{

Callers 2

tarFolderMethod · 0.85
tarFileMethod · 0.85

Calls 2

ModeMethod · 0.45
IsDirMethod · 0.45

Tested by

no test coverage detected