GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - tayue/collection: go collection package for fasting coding

BranchesTags
Open more actions menu
 
 

Latest commit

 

History

106 Commits
106 Commits

Folders and files

NameName
Last commit message
Last commit date
dist
dist
 
 
docs
docs
 
 
.gitignore
.gitignore
 
 
CONTRIBUTING.md
CONTRIBUTING.md
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
abs_array.go
abs_array.go
 
 
abs_array_test.go
abs_array_test.go
 
 
array.go
array.go
 
 
float32_collection.go
float32_collection.go
 
 
float32_collection_test.go
float32_collection_test.go
 
 
float64_collection.go
float64_collection.go
 
 
float64_collection_test.go
float64_collection_test.go
 
 
go.mod
go.mod
 
 
go.sum
go.sum
 
 
int32_collection.go
int32_collection.go
 
 
int32_collection_test.go
int32_collection_test.go
 
 
int64_collection.go
int64_collection.go
 
 
int64_collection_test.go
int64_collection_test.go
 
 
int_collection.go
int_collection.go
 
 
int_collection_test.go
int_collection_test.go
 
 
mix.go
mix.go
 
 
obj_collection.go
obj_collection.go
 
 
obj_collection_test.go
obj_collection_test.go
 
 
obj_point_collection.go
obj_point_collection.go
 
 
obj_point_collection_bench_test.go
obj_point_collection_bench_test.go
 
 
obj_point_collection_test.go
obj_point_collection_test.go
 
 
package.json
package.json
 
 
str_collection.go
str_collection.go
 
 
str_collection_test.go
str_collection_test.go
 
 

Repository files navigation

collection

Collection包目标是用于替换golang原生的Slice,使用场景是在大量不追求极致性能,追求业务开发效能的场景。

Collection的使用手册线上地址:http://collection.funaio.cn

版本 说明
v1.3.1 增加一些说明文档
v1.3.0 增加文档说明
v1.2.0 增加对象指针数组,增加测试覆盖率, 增加ToInterfaces方法
1.1.2 增加一些空数组的判断,解决一些issue
1.1.1 对collection包进行了json解析和反解析的支持,对mix类型支持了SetField和RemoveFields的类型设置
1.1.0 增加了对int32的支持,增加了延迟加载,增加了Copy函数,增加了compare从ICollection传递到IMix,使用快排加速了Sort方法
1.0.1 第一次发布

go get github.com/jianfengye/[email protected]

Collection包目前支持的元素类型:int32, int, int64, float32, float64, string, struct, struct_point。

使用下列几个方法进行初始化Collection:

NewIntCollection(objs []int) *IntCollection

NewInt64Collection(objs []int64) *Int64Collection

NewInt32Collection(objs []int32) *Int32Collection

NewFloat64Collection(objs []float64) *Float64Collection

NewFloat32Collection(objs []float32) *Float32Collection

NewStrCollection(objs []string) *StrCollection

NewObjCollection(objs interface{}) *ObjCollection

NewObjPointCollection(objs interface{}) *ObjPointCollection

Collection的Error是随着Collection对象走,或者下沉到IMix中,所以可以放心在ICollection和IMix进行链式调用,只需要最后进行一次错误检查即可。

ret, err := objColl.Map(func(item interface{}, key int) IMix {
    foo := item.(Foo)
    return NewMix(foo.A)
}).Reduce(func(carry IMix, item IMix) IMix {
    ret, _ := carry.ToString()
    join, _ := item.ToString()
    return NewMix(ret + join)
}).ToString()
if err != nil {
    ...
}

License

collection is licensed under Apache License.

Contributors

This project exists thanks to all the people who contribute. [Contribute].

Backers

Thank you to all our backers! 🙏 [Become a backer]

Sponsors

Support this project by becoming a sponsor. Your logo will show up here with a link to your website. [Become a sponsor]

About

go collection package for fasting coding

Resources

Readme
Apache-2.0 license

Contributing

Contributing
Activity

Stars

1 star

Watchers

0 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.