Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 932 for Stringer (0.19 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/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)
  6. 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)
  7. 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)
  8. test/typeparam/issue50642.go

    	return ok
    }
    
    type MyInt int
    
    func (i MyInt) String() string {
    	return "a"
    }
    
    type Stringer interface {
    	String() string
    }
    
    type Temp2[T Stringer] struct {
    }
    
    var temp2 Stringer
    
    func (it Temp2[T]) HasNext() string {
    	var x map[int]T
    
    	var ok bool
    	// test conversion of T to Stringer during an OAS2MAPR
    	temp2, ok = x[43]
    	_ = ok
    	return temp2.String()
    }
    
    func main() {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Mar 01 19:45:34 UTC 2022
    - 1013 bytes
    - Viewed (0)
  9. src/debug/macho/reloctype_string.go

    // Code generated by "stringer -type=RelocTypeGeneric,RelocTypeX86_64,RelocTypeARM,RelocTypeARM64 -output reloctype_string.go"; DO NOT EDIT.
    
    package macho
    
    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[GENERIC_RELOC_VANILLA-0]
    	_ = x[GENERIC_RELOC_PAIR-1]
    	_ = x[GENERIC_RELOC_SECTDIFF-2]
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Apr 11 20:24:07 UTC 2023
    - 4.3K bytes
    - Viewed (0)
  10. src/cmd/internal/obj/addrtype_string.go

    // Code generated by "stringer -type AddrType"; DO NOT EDIT.
    
    package obj
    
    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[TYPE_NONE-0]
    	_ = x[TYPE_BRANCH-1]
    	_ = x[TYPE_TEXTSIZE-2]
    	_ = x[TYPE_MEM-3]
    	_ = x[TYPE_CONST-4]
    	_ = x[TYPE_FCONST-5]
    	_ = x[TYPE_SCONST-6]
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Apr 01 03:16:26 UTC 2022
    - 1.1K bytes
    - Viewed (0)
Back to top