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

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

bj
登录
  • 友情链接
站内
generics

generics

go

将类型T转换为类型U的身份函数中。

英文: Convert type T to type U in an identity function 问题 根据给定的类型签名,是否有办法实现类似下面的操作? func Transform[T, ...
huangapple 2022年11月11日140评论generics go
go

泛型:处理具有相同数据成员类型的不同结构类型

英文: go generics: processing different struct types with same data member types 问题 有两种结构类型,Foo和Bar,都有...
huangapple 2022年11月8日146评论generics go
go

通用类型不属于接口类型

英文: Generic type which isn't of an interface type 问题 我正在尝试使用泛型来创建一个参数化类型,它可以是以下类型之一: T、*T、T[]、ma...
huangapple 2022年11月6日142评论generics go
go

Go泛型:为零参数的可变参数函数推断类型参数

英文: Go generics: infer type parameter for variadic function with zero arguments 问题 假设我有一个带有两个泛型参数的函数...
huangapple 2022年11月5日159评论generics go
go

如何在Golang中将一个通用的结构体转换为不同类型的相同通用结构体?

英文: How do I convert a generic struct to the same generic struct of a different type in Golang? 问题 让...
huangapple 2022年10月17日136评论generics go
go

How to flatten JSON for a generic type in Go

英文: How to flatten JSON for a generic type in Go 问题 我正在尝试在Go中实现HAL,只是为了看看我能不能做到。这意味着我有一个HAL类型,它对有效负载...
huangapple 2022年10月15日157评论go json
go

在Golang中,如何将接口作为泛型类型与nil进行比较?

英文: In Golang, how to compare interface as generics type to nil? 问题 我需要一个链接节点来保存一些不同的接口类型,所以我使用了泛型来创...
huangapple 2022年10月9日157评论generics go
go

如何创建一个具有推断的可空可比较泛型的函数?

英文: How to make a function with inferred nillable comparable generics? 问题 考虑以下函数: func NilCompare[T ...
huangapple 2022年10月7日130评论generics go
go

如何编写一个通用函数,该函数接受一个字符串或一个错误作为参数?

英文: How to write a generic function that takes a string or an error as a parameter? 问题 有没有办法将字符串或错误作...
huangapple 2022年10月4日151评论generics go
go

从泛型结构中使用反射获取类型参数。

英文: Get type parameter from a generic struct using reflection 问题 假设我有以下结构体: type MyGeneric[T string ...
huangapple 2022年9月27日149评论generics go
63

文章导航

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

热门标签

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

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

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

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

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

    本页二维码