- Sort Score
- Result 10 results
- Languages All
Results 31 - 40 of 675 for Map (1.29 sec)
-
src/internal/types/testdata/fixedbugs/issue40789.go
// license that can be found in the LICENSE file. package main import "fmt" func main() { m := map[string]int{ "a": 6, "b": 7, } fmt.Println(copyMap[map[string]int, string, int](m)) } type Map[K comparable, V any] interface { map[K] V } func copyMap[M Map[K, V], K comparable, V any](m M) M { m1 := make(M) for k, v := range m { m1[k] = v } return m1 }
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Fri Sep 02 02:58:32 UTC 2022 - 614 bytes - Viewed (0) -
src/text/template/template.go
return t } // Funcs adds the elements of the argument map to the template's function map. // It must be called before the template is parsed. // It panics if a value in the map is not a function with appropriate return // type or if the name cannot be used syntactically as a function in a template. // It is legal to overwrite elements of the map. The return value is the template, // so calls can be chained.
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Mon Feb 26 20:57:51 UTC 2024 - 7.2K bytes - Viewed (0) -
src/go/types/self_test.go
} var info *Info if writeInfo { info = &Info{ Types: make(map[ast.Expr]TypeAndValue), Defs: make(map[*ast.Ident]Object), Uses: make(map[*ast.Ident]Object), Implicits: make(map[ast.Node]Object), Selections: make(map[*ast.SelectorExpr]*Selection), Scopes: make(map[ast.Node]*Scope), } } if _, err := conf.Check(path, fset, files, info); err != nil {
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Tue May 23 19:39:00 UTC 2023 - 2.8K bytes - Viewed (0) -
src/cmd/compile/internal/types/pkg.go
// instantiations. p.Prefix = path } else { p.Prefix = objabi.PathToPrefix(path) } p.Syms = make(map[string]*Sym) pkgMap[path] = p return p } func PkgMap() map[string]*Pkg { return pkgMap } var nopkg = &Pkg{ Syms: make(map[string]*Sym), } func (pkg *Pkg) Lookup(name string) *Sym { s, _ := pkg.LookupOK(name) return s }
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Wed Nov 08 16:28:50 UTC 2023 - 3.1K bytes - Viewed (0) -
src/maps/maps.go
// Values are compared using ==. func Equal[M1, M2 ~map[K]V, K, V comparable](m1 M1, m2 M2) bool { if len(m1) != len(m2) { return false } for k, v1 := range m1 { if v2, ok := m2[k]; !ok || v1 != v2 { return false } } return true } // EqualFunc is like Equal, but compares values using eq. // Keys are still compared with ==.
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Wed Feb 28 20:35:05 UTC 2024 - 1.8K bytes - Viewed (0) -
src/internal/types/testdata/fixedbugs/issue51158.go
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Fri Sep 02 02:58:32 UTC 2022 - 463 bytes - Viewed (0) -
src/internal/types/testdata/fixedbugs/issue51229.go
// Again, the order of the type parameters shouldn't matter. func g0[S ~[]E, M ~map[string]S, E any](m M) {} func g1[M ~map[string]S, S ~[]E, E any](m M) {} func g2[E any, S ~[]E, M ~map[string]S](m M) {} func g3[S ~[]E, E any, M ~map[string]S](m M) {} func g4[M ~map[string]S, E any, S ~[]E](m M) {} func g5[E any, M ~map[string]S, S ~[]E](m M) {} func _(m map[string][]byte) { g0(m) g1(m) g2(m) g3(m) g4(m) g5(m) }
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Tue Jan 17 19:54:27 UTC 2023 - 4.8K bytes - Viewed (0) -
test/typeparam/orderedmap.go
// Package orderedmap provides an ordered map, implemented as a binary tree. package main import ( "bytes" "context" "fmt" "runtime" ) type Ordered interface { ~int | ~int8 | ~int16 | ~int32 | ~int64 | ~uint | ~uint8 | ~uint16 | ~uint32 | ~uint64 | ~uintptr | ~float32 | ~float64 | ~string } // _Map is an ordered map. type _Map[K, V any] struct { root *node[K, V]
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Tue Mar 01 19:45:34 UTC 2022 - 7.1K bytes - Viewed (0) -
test/fixedbugs/issue17631.go
package main import "time" func main() { _ = struct { about string before map[string]uint update map[string]int updateTime time.Time expect map[string]int }{ about: "this one", updates: map[string]int{"gopher": 10}, // ERROR "unknown field updates in struct literal of type|unknown field .*updates.* in .*unnamed struct.*" }
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Tue Sep 27 21:59:09 UTC 2022 - 540 bytes - Viewed (0) -
src/cmd/vendor/golang.org/x/tools/go/analysis/validate.go
func Validate(analyzers []*Analyzer) error { // Map each fact type to its sole generating analyzer. factTypes := make(map[reflect.Type]*Analyzer) // Traverse the Requires graph, depth first. const ( white = iota grey black finished ) color := make(map[*Analyzer]uint8) var visit func(a *Analyzer) error visit = func(a *Analyzer) error { if a == nil {
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Mon Nov 20 21:52:54 UTC 2023 - 3.1K bytes - Viewed (0)