update latest prometheus client dependency and its dependencies

This commit is contained in:
Mechiel Lukkien
2023-11-09 21:43:47 +01:00
parent 8c99e54ec1
commit b2af63b3ec
124 changed files with 6171 additions and 3595 deletions

View File

@ -65,7 +65,7 @@ type ProcMap struct {
func parseDevice(s string) (uint64, error) {
toks := strings.Split(s, ":")
if len(toks) < 2 {
return 0, fmt.Errorf("unexpected number of fields")
return 0, fmt.Errorf("%w: unexpected number of fields, expected: 2, got: %q", ErrFileParse, len(toks))
}
major, err := strconv.ParseUint(toks[0], 16, 0)
@ -95,7 +95,7 @@ func parseAddress(s string) (uintptr, error) {
func parseAddresses(s string) (uintptr, uintptr, error) {
toks := strings.Split(s, "-")
if len(toks) < 2 {
return 0, 0, fmt.Errorf("invalid address")
return 0, 0, fmt.Errorf("%w: invalid address", ErrFileParse)
}
saddr, err := parseAddress(toks[0])
@ -114,7 +114,7 @@ func parseAddresses(s string) (uintptr, uintptr, error) {
// parsePermissions parses a token and returns any that are set.
func parsePermissions(s string) (*ProcMapPermissions, error) {
if len(s) < 4 {
return nil, fmt.Errorf("invalid permissions token")
return nil, fmt.Errorf("%w: invalid permissions token", ErrFileParse)
}
perms := ProcMapPermissions{}
@ -141,7 +141,7 @@ func parsePermissions(s string) (*ProcMapPermissions, error) {
func parseProcMap(text string) (*ProcMap, error) {
fields := strings.Fields(text)
if len(fields) < 5 {
return nil, fmt.Errorf("truncated procmap entry")
return nil, fmt.Errorf("%w: truncated procmap entry", ErrFileParse)
}
saddr, eaddr, err := parseAddresses(fields[0])