import "v.io/x/ref/lib/vdl/vdlutil"
Package vdlutil implements utilities used by many VDL components. It should have a small set of dependencies.
var ( // Vlog is a logger that discards output by default, and only outputs real // logs when SetVerbose is called. Vlog = log.New(ioutil.Discard, logPrefix, logFlags) )
FirstRuneToExportCase returns s with its first rune in uppercase if export is true, otherwise in lowercase.
FirstRuneToLower returns s with its first rune in lowercase.
FirstRuneToUpper returns s with its first rune in uppercase.
func SetVerbose()
SetVerbose tells the vdl package (and subpackages) to enable verbose logging.
toConstCase converts ThisString to THIS_STRING. For adding '_', we follow the following algorithm. For any sequence of three characters, c[n-1], c[n], c[n+1], we add an underscore before c[n] if:
1) c[n-1] is a digit and c[n] is a letter, or 2) c[n-1] is a letter and c[n] is a digit, or 3) c[n-1] is lowercase, and c[n] is uppercase, or 4) c[n-1] is uppercase, c[n] is uppercase, and c[n+1] is lowercase.
Errors holds a buffer of encountered errors. The point is to try displaying all errors to the user rather than just the first. We cutoff at MaxErrors to ensure if something's really messed up we won't spew errors forever. Set MaxErrors=-1 to effectively continue despite any number of errors. The zero Errors struct stops at the first error encountered.
NewErrors returns a new Errors object, holding up to max errors.
Error adds the error described by msg to the buffer. Returns true iff we're still under the MaxErrors cutoff.
Errorf is like Error, and takes the same args as fmt.Printf.
IsEmpty returns true iff there weren't any errors.
IsFull returns true iff we hit the MaxErrors cutoff.
NumErrors returns the number of errors we've seen.
Reset clears the internal state so you start with no buffered errors. MaxErrors remains the same; if you want to change it you should create a new Errors struct.
String returns the buffered errors as a single human-readable string.
ToError returns the buffered errors as a single error, or nil if there weren't any errors.
Package vdlutil imports 9 packages (graph) and is imported by 18 packages. Updated 2018-08-27. Refresh now. Tools for package owners.