Add godoc strings to all exported types, functions, and fields
Documents: - cli: NO_COLOR, RunOptions fields, CLIApp, VersionString - checker: Result fields, Status constants, CheckStatus fields - scanner: EnumerateStatus, ScanStatus, Options, FileEntry fields - log: Level alias, DisableStyling, Init, Info/Debug functions, verbosity helpers, GetLogger, GetLevel, WithError - mfer: ManifestScanOptions, New, NewFromPaths, NewFromFS, MAGIC
This commit is contained in:
@@ -39,9 +39,10 @@ func (m *manifest) String() string {
|
||||
return fmt.Sprintf("<Manifest count=%d totalSize=%d>", len(m.files), m.totalFileSize)
|
||||
}
|
||||
|
||||
// ManifestScanOptions configures behavior when scanning directories for manifest generation.
|
||||
type ManifestScanOptions struct {
|
||||
IgnoreDotfiles bool
|
||||
FollowSymLinks bool
|
||||
IgnoreDotfiles bool // Skip files and directories starting with a dot
|
||||
FollowSymLinks bool // Resolve symlinks instead of skipping them
|
||||
}
|
||||
|
||||
func (m *manifest) HasError() bool {
|
||||
@@ -77,11 +78,13 @@ func (m *manifest) addInputFS(f afero.Fs) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// New creates an empty manifest.
|
||||
func New() *manifest {
|
||||
m := &manifest{}
|
||||
return m
|
||||
}
|
||||
|
||||
// NewFromPaths creates a manifest configured to scan the given filesystem paths.
|
||||
func NewFromPaths(options *ManifestScanOptions, inputPaths ...string) (*manifest, error) {
|
||||
log.Dump(inputPaths)
|
||||
m := New()
|
||||
@@ -95,6 +98,7 @@ func NewFromPaths(options *ManifestScanOptions, inputPaths ...string) (*manifest
|
||||
return m, nil
|
||||
}
|
||||
|
||||
// NewFromFS creates a manifest configured to scan the given afero filesystem.
|
||||
func NewFromFS(options *ManifestScanOptions, fs afero.Fs) (*manifest, error) {
|
||||
m := New()
|
||||
m.scanOptions = options
|
||||
|
||||
@@ -10,9 +10,7 @@ import (
|
||||
"google.golang.org/protobuf/proto"
|
||||
)
|
||||
|
||||
// was go-generate protoc --go_out=. --go_opt=paths=source_relative mf.proto
|
||||
|
||||
// rot13("MANIFEST")
|
||||
// MAGIC is the file format magic bytes prefix (rot13 of "MANIFEST").
|
||||
const MAGIC string = "ZNAVSRFG"
|
||||
|
||||
func newTimestampFromTime(t time.Time) *Timestamp {
|
||||
|
||||
Reference in New Issue
Block a user