Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 29 for KindString (0.25 sec)

  1. src/log/slog/value_access_benchmark_test.go

    		bb bool
    		u  uint64
    		d  time.Duration
    		f  float64
    		a  any
    	)
    	b.Run("switch-checked", func(b *testing.B) {
    		for i := 0; i < b.N; i++ {
    			for _, v := range vs {
    				switch v.Kind() {
    				case KindString:
    					s = v.String()
    				case KindInt64:
    					ii = v.Int64()
    				case KindUint64:
    					u = v.Uint64()
    				case KindFloat64:
    					f = v.Float64()
    				case KindBool:
    					bb = v.Bool()
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Mar 21 20:55:33 UTC 2023
    - 4.3K bytes
    - Viewed (0)
  2. src/log/slog/value.go

    // The zero Value corresponds to nil.
    type Value struct {
    	_ [0]func() // disallow ==
    	// num holds the value for Kinds Int64, Uint64, Float64, Bool and Duration,
    	// the string length for KindString, and nanoseconds since the epoch for KindTime.
    	num uint64
    	// If any is of type Kind, then the value is in num as described above.
    	// If any is of type *time.Location, then the Kind is Time and time.Time value
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 16 16:12:08 UTC 2024
    - 13.3K bytes
    - Viewed (0)
  3. src/log/slog/internal/benchmarks/handlers.go

    		return true
    	})
    	buf.WriteByte('\n')
    	_, err := h.w.Write(*buf)
    	return err
    }
    
    func (h *fastTextHandler) appendValue(buf *buffer.Buffer, v slog.Value) {
    	switch v.Kind() {
    	case slog.KindString:
    		buf.WriteString(v.String())
    	case slog.KindInt64:
    		*buf = strconv.AppendInt(*buf, v.Int64(), 10)
    	case slog.KindUint64:
    		*buf = strconv.AppendUint(*buf, v.Uint64(), 10)
    	case slog.KindFloat64:
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Apr 12 20:33:37 UTC 2023
    - 4.1K bytes
    - Viewed (0)
  4. src/log/slog/text_handler.go

    // io.Writer.Write.
    func (h *TextHandler) Handle(_ context.Context, r Record) error {
    	return h.commonHandler.handle(r)
    }
    
    func appendTextValue(s *handleState, v Value) error {
    	switch v.Kind() {
    	case KindString:
    		s.appendString(v.str())
    	case KindTime:
    		s.appendTime(v.time())
    	case KindAny:
    		if tm, ok := v.any.(encoding.TextMarshaler); ok {
    			data, err := tm.MarshalText()
    			if err != nil {
    				return err
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Oct 23 22:56:07 UTC 2023
    - 4.7K bytes
    - Viewed (0)
  5. src/log/slog/json_handler.go

    	}
    	s.buf.WriteByte('"')
    	*s.buf = t.AppendFormat(*s.buf, time.RFC3339Nano)
    	s.buf.WriteByte('"')
    }
    
    func appendJSONValue(s *handleState, v Value) error {
    	switch v.Kind() {
    	case KindString:
    		s.appendString(v.str())
    	case KindInt64:
    		*s.buf = strconv.AppendInt(*s.buf, v.Int64(), 10)
    	case KindUint64:
    		*s.buf = strconv.AppendUint(*s.buf, v.Uint64(), 10)
    	case KindFloat64:
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Nov 17 16:18:11 UTC 2023
    - 8.1K bytes
    - Viewed (0)
  6. src/go/types/expr.go

    	case *Slice, *Signature, *Map:
    		return check.kindString(typ) + " can only be compared to nil"
    	}
    	// see if we can extract a more specific error
    	var cause string
    	comparable(typ, true, nil, func(format string, args ...interface{}) {
    		cause = check.sprintf(format, args...)
    	})
    	return cause
    }
    
    // kindString returns the type kind as a string.
    func (check *Checker) kindString(typ Type) string {
    	switch under(typ).(type) {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 29 02:09:54 UTC 2024
    - 49.7K bytes
    - Viewed (0)
  7. api/go1.21.txt

    pkg log/slog, const KindInt64 = 4 #56345
    pkg log/slog, const KindInt64 Kind #56345
    pkg log/slog, const KindLogValuer = 9 #56345
    pkg log/slog, const KindLogValuer Kind #56345
    pkg log/slog, const KindString = 5 #56345
    pkg log/slog, const KindString Kind #56345
    pkg log/slog, const KindTime = 6 #56345
    pkg log/slog, const KindTime Kind #56345
    pkg log/slog, const KindUint64 = 7 #56345
    pkg log/slog, const KindUint64 Kind #56345
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Aug 07 09:39:17 UTC 2023
    - 25.6K bytes
    - Viewed (0)
  8. src/cmd/compile/internal/types2/expr.go

    	case *Slice, *Signature, *Map:
    		return check.kindString(typ) + " can only be compared to nil"
    	}
    	// see if we can extract a more specific error
    	var cause string
    	comparable(typ, true, nil, func(format string, args ...interface{}) {
    		cause = check.sprintf(format, args...)
    	})
    	return cause
    }
    
    // kindString returns the type kind as a string.
    func (check *Checker) kindString(typ Type) string {
    	switch under(typ).(type) {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 29 02:09:54 UTC 2024
    - 51.7K bytes
    - Viewed (0)
  9. src/cmd/vendor/golang.org/x/mod/internal/lazyregexp/lazyre.go

    	return r.re().FindStringSubmatchIndex(s)
    }
    
    func (r *Regexp) ReplaceAllString(src, repl string) string {
    	return r.re().ReplaceAllString(src, repl)
    }
    
    func (r *Regexp) FindString(s string) string {
    	return r.re().FindString(s)
    }
    
    func (r *Regexp) FindAllString(s string, n int) []string {
    	return r.re().FindAllString(s, n)
    }
    
    func (r *Regexp) MatchString(s string) bool {
    	return r.re().MatchString(s)
    }
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Jul 12 20:38:21 UTC 2023
    - 1.8K bytes
    - Viewed (0)
  10. src/internal/lazyregexp/lazyre.go

    	return r.re().FindStringSubmatchIndex(s)
    }
    
    func (r *Regexp) ReplaceAllString(src, repl string) string {
    	return r.re().ReplaceAllString(src, repl)
    }
    
    func (r *Regexp) FindString(s string) string {
    	return r.re().FindString(s)
    }
    
    func (r *Regexp) FindAllString(s string, n int) []string {
    	return r.re().FindAllString(s, n)
    }
    
    func (r *Regexp) MatchString(s string) bool {
    	return r.re().MatchString(s)
    }
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Feb 27 23:49:01 UTC 2019
    - 1.8K bytes
    - Viewed (0)
Back to top