Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 1,041 for Stringer (0.12 sec)

  1. test/typeparam/stringer.go

    // Test method calls on type parameters
    
    package main
    
    import (
    	"fmt"
    	"reflect"
    	"strconv"
    )
    
    // Simple constraint
    type Stringer interface {
    	String() string
    }
    
    func stringify[T Stringer](s []T) (ret []string) {
    	for _, v := range s {
    		ret = append(ret, v.String())
    	}
    	return ret
    }
    
    type myint int
    
    func (i myint) String() string {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Mar 01 19:45:34 UTC 2022
    - 1.6K bytes
    - Viewed (0)
  2. src/cmd/internal/obj/stringer.go

    // Copyright 2015 The Go Authors. All rights reserved.
    // Use of this source code is governed by a BSD-style
    // license that can be found in the LICENSE file.
    
    //go:build ignore
    
    // This is a mini version of the stringer tool customized for the Anames table
    // in the architecture support for obj.
    // This version just generates the slice of strings, not the String method.
    
    package main
    
    import (
    	"bufio"
    	"flag"
    	"fmt"
    	"log"
    	"os"
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Oct 19 23:33:27 UTC 2023
    - 2.2K bytes
    - Viewed (0)
  3. test/fixedbugs/issue65808.go

    // license that can be found in the LICENSE file.package main
    
    package main
    
    type Stringer interface {
    	String() string
    }
    
    type (
    	stringer  struct{}
    	stringers [2]stringer
    	foo       struct {
    		stringers
    	}
    )
    
    func (stringer) String() string  { return "" }
    func toString(s Stringer) string { return s.String() }
    
    func (v stringers) toStrings() []string {
    	return []string{toString(v[0]), toString(v[1])}
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Sat Mar 02 14:01:52 UTC 2024
    - 562 bytes
    - Viewed (0)
  4. staging/src/k8s.io/apiserver/pkg/endpoints/handlers/trace_util.go

    	return []attribute.KeyValue{
    		attribute.Stringer("accept", &lazyAccept{req: req}),
    		attribute.Stringer("audit-id", &lazyAuditID{req: req}),
    		attribute.Stringer("client", &lazyClientIP{req: req}),
    		attribute.Stringer("api-group", &lazyAPIGroup{req: req}),
    		attribute.Stringer("api-version", &lazyAPIVersion{req: req}),
    		attribute.Stringer("name", &lazyName{req: req}),
    		attribute.Stringer("subresource", &lazySubresource{req: req}),
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Sun Sep 03 15:25:35 UTC 2023
    - 1.5K bytes
    - Viewed (0)
  5. test/switch7.go

    	switch e.(type) {
    	case int:
    	case int: // ERROR "duplicate case int in type switch"
    	case int64:
    	case error:
    	case error: // ERROR "duplicate case error in type switch"
    	case fmt.Stringer:
    	case fmt.Stringer: // ERROR "duplicate case fmt.Stringer in type switch"
    	case struct {
    		i int "tag1"
    	}:
    	case struct {
    		i int "tag2"
    	}:
    	case struct { // ERROR "duplicate case struct { i int .tag1. } in type switch|duplicate case"
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Dec 14 21:28:48 UTC 2020
    - 796 bytes
    - Viewed (0)
  6. test/fixedbugs/issue19548.dir/a.go

    // license that can be found in the LICENSE file.
    
    package a
    
    type Mode uint
    
    func (m Mode) String() string { return "mode string" }
    func (m *Mode) Addr() *Mode   { return m }
    
    type Stringer interface {
    	String() string
    }
    
    var global Stringer
    var m Mode
    
    func init() {
    	// force compilation of the (*Mode).String() wrapper
    	global = &m
    }
    
    func String() string {
    	return global.String() + Mode(0).String()
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Mar 15 00:27:13 UTC 2017
    - 516 bytes
    - Viewed (0)
  7. test/fixedbugs/issue15528.go

    	{fmt.Stringer(Strunger(((*Int)(nil)))), "*main.Int <nil>"},
    }
    
    type Int int
    
    func (i Int) String() string { return fmt.Sprintf("Int=%d", i) }
    func (i Int) Strung()        {}
    
    type Strunger interface {
    	fmt.Stringer
    	Strung()
    }
    
    // Test correct construction of static non-empty interface values
    var ifaces = [...]struct {
    	x fmt.Stringer
    	s string
    }{
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Sep 12 14:31:26 UTC 2016
    - 3.1K bytes
    - Viewed (0)
  8. test/typeparam/boundmethod.go

    //go:noinline
    func (m myint) String() string {
    	return strconv.Itoa(int(m))
    }
    
    type Stringer interface {
    	String() string
    }
    
    func stringify[T Stringer](s []T) (ret []string) {
    	for _, v := range s {
    		// Test normal bounds method call on type param
    		x1 := v.String()
    
    		// Test converting type param to its bound interface first
    		v1 := Stringer(v)
    		x2 := v1.String()
    
    		// Test method expression with type param type
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Sep 25 14:29:30 UTC 2023
    - 2.7K bytes
    - Viewed (0)
  9. cmd/batchjobmetric_string.go

    // Code generated by "stringer -type=batchJobMetric -trimprefix=batchJobMetric batch-handlers.go"; DO NOT EDIT.
    
    package cmd
    
    import "strconv"
    
    func _() {
    	// An "invalid array index" compiler error signifies that the constant values have changed.
    	// Re-run the stringer command to generate them again.
    	var x [1]struct{}
    	_ = x[batchJobMetricReplication-0]
    	_ = x[batchJobMetricKeyRotation-1]
    	_ = x[batchJobMetricExpire-2]
    }
    
    Registered: Sun Jun 16 00:44:34 UTC 2024
    - Last Modified: Sat Dec 02 10:51:33 UTC 2023
    - 797 bytes
    - Viewed (0)
  10. cmd/healingmetric_string.go

    // Code generated by "stringer -type=healingMetric -trimprefix=healingMetric erasure-healing.go"; DO NOT EDIT.
    
    package cmd
    
    import "strconv"
    
    func _() {
    	// An "invalid array index" compiler error signifies that the constant values have changed.
    	// Re-run the stringer command to generate them again.
    	var x [1]struct{}
    	_ = x[healingMetricBucket-0]
    	_ = x[healingMetricObject-1]
    	_ = x[healingMetricCheckAbandonedParts-2]
    }
    
    Registered: Sun Jun 16 00:44:34 UTC 2024
    - Last Modified: Mon Nov 28 18:20:55 UTC 2022
    - 789 bytes
    - Viewed (0)
Back to top