Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 2 of 2 for isEmptyGroup (0.1 sec)

  1. src/log/slog/record.go

    	for _, a := range attrs[i:] {
    		if !a.Value.isEmptyGroup() {
    			r.back = append(r.back, a)
    		}
    	}
    }
    
    // Add converts the args to Attrs as described in [Logger.Log],
    // then appends the Attrs to the [Record]'s list of Attrs.
    // It omits empty groups.
    func (r *Record) Add(args ...any) {
    	var a Attr
    	for len(args) > 0 {
    		a, args = argsToAttr(args)
    		if a.Value.isEmptyGroup() {
    			continue
    		}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Nov 08 16:30:56 UTC 2023
    - 6K bytes
    - Viewed (0)
  2. src/log/slog/value.go

    		for _, a := range as {
    			if !a.Value.isEmptyGroup() {
    				as2 = append(as2, a)
    			}
    		}
    		as = as2
    	}
    	return Value{num: uint64(len(as)), any: groupptr(unsafe.SliceData(as))}
    }
    
    // countEmptyGroups returns the number of empty group values in its argument.
    func countEmptyGroups(as []Attr) int {
    	n := 0
    	for _, a := range as {
    		if a.Value.isEmptyGroup() {
    			n++
    		}
    	}
    	return n
    }
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 16 16:12:08 UTC 2024
    - 13.3K bytes
    - Viewed (0)
Back to top