开发者交流平台
开发者交流平台

通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。

bj
登录
  • 友情链接
站内
generics

generics

go

在Go语言中,可以在结构体内部创建通用的结构体字段,并进行初始化。

英文: Create generic struct fields inside a struct and initial in go 问题 如何在Go中创建一个包含通用结构的结构体,并对其进行初始化?...
huangapple 2022年12月8日153评论go struct
go

遍历传入泛型的 []rune | string。

英文: Iterate over a []rune | string passed in generics 问题 我正在使用这个约束规则来处理泛型: type LineParser[T []rune ...
huangapple 2022年12月6日155评论generics go
go

为什么在Go语言中,当函数返回一个函数时,泛型会失败?

英文: Why do Go generics fail when function returns a function? 问题 我刚刚开始尝试在Go语言中使用泛型,并遇到了一个我不太理解为什么会失败...
huangapple 2022年12月5日154评论generics go
go

如何将字符串枚举与方法一起作为泛型参数使用?

英文: How to use a string enum with a method as a generic parameter? 问题 我有多个基于字符串的枚举类型,它们共享一个名为Validat...
huangapple 2022年12月1日152评论generics go
go

你可以使用运行时类型反射来进行类型转换。

英文: How can I cast type using runtime type reflection? 问题 我正在尝试使用泛型构建一个函数,将接口切片转换为类型为 T 的切片。 我想到了以下代...
huangapple 2022年11月29日154评论generics go
go

将具有精确约束的类型参数传递给具有该参数的函数?

英文: Pass type parameter with exact constraint to function with that argument? 问题 我开始使用 Go 的泛型,并且很难理解...
huangapple 2022年11月27日152评论generics go
go

如何将 `type Int32 int32` 转换为 `int32`?

英文: How to convert `type Int32 int32` to `int32`? 问题 我们有以下生成的代码(所以我们不能将其更改为type Enum interface { int...
huangapple 2022年11月26日189评论generics go
go

如何为可以使用len()函数的内容编写Go类型约束?

英文: How to write a Go type constraint for something you can take len() of? 问题 我正在尝试为一个Go程序编写类型约束,该约束...
huangapple 2022年11月23日160评论generics go
go

创建具有指向类型参数的指针的通用类型实例。

英文: Create instance of generic type with pointer to type parameter 问题 给定以下类型定义: type N interface{ ~i...
huangapple 2022年11月18日144评论generics go
go

Go – Enforce that an interface is only satisfied by types with a pointer receiver on a method?

英文: Go - Enforce that an interface is only satisfied by types with a pointer receiver on a method? 问...
huangapple 2022年11月17日145评论generics go
63

文章导航

1 … 20 21 22 23 24 25 26 27 28 … 63
name
开发者交流平台
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
文章117266 留言 4 访客17122526

热门标签

flutter sql typescript r node.js java css c# android spring-boot spring pandas go python arrays html javascript reactjs c++ json

悟已往之不谏,知来者之可追!

今日
00%
已00小时
本周
00%
已过00天
本月
00%
已过00天
今年
00%
已是00月

Copyright ©  开发者交流平台 版权所有.

闽 ICP 备 2022019110 号 - 1
  • 开发者交流平台

    本页二维码