-
Notifications
You must be signed in to change notification settings - Fork 5
/
.gomarkdoc.yml
64 lines (48 loc) · 3.01 KB
/
.gomarkdoc.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
output: "README.md"
embed: "."
includeUnexported: "false"
header: |+
[![License](https://img.shields.io/github/license/nwillc/genfuncs.svg)](https://tldrlegal.com/license/-isc-license)
[![CI](https://github.com/nwillc/genfuncs/workflows/CI/badge.svg)](https://github.com/nwillc/genfuncs/actions/workflows/CI.yml)
[![codecov.io](https://codecov.io/github/nwillc/genfuncs/coverage.svg?branch=master)](https://codecov.io/github/nwillc/genfuncs?branch=master)
[![goreportcard.com](https://goreportcard.com/badge/github.com/nwillc/genfuncs)](https://goreportcard.com/report/github.com/nwillc/genfuncs)
[![Reference](https://img.shields.io/badge/go.dev-reference-007d9c?logo=go&logoColor=white)](https://pkg.go.dev/github.com/nwillc/genfuncs)
[![Mentioned in Awesome Go](https://awesome.re/mentioned-badge.svg)](https://github.com/avelino/awesome-go)
[![Releases](https://img.shields.io/github/tag/nwillc/genfuncs.svg)](https://github.com/nwillc/genfuncs/tags)
# Genfuncs Package
Genfuncs implements various functions utilizing Go's Generics to help avoid writing boilerplate code,
in particular when working with containers like heap, list, map, queue, set, slice, etc. Many of the functions are
based on Kotlin's Sequence and Map. Some functional patterns like Result and Promises are presents. Attempts were also
made to introduce more polymorphism into Go's containers. This package, while very usable, is primarily a
proof-of-concept since it is likely Go will provide similar before long. In fact, golang.org/x/exp/slices
and golang.org/x/exp/maps offer some similar functions and I incorporate them here.
## Code Style
The coding style is not always idiomatic, in particular:
- All functions have named return values and those variable are used in the return statements.
- Some places where the `range` build-in could have been used instead use explicit indexing.
Both of these, while less idiomatic, were done because they measurably improve performance.
## General notes:
- A Map interface is provided to allow both Go's normal map and it's sync.Map to be used polymorphically.
- The bias of these functions where appropriate is to be pure, without side effects, at the cost of copying data.
- Examples are found in `*examples_test.go` files or projects like [gordle](https://github.com/nwillc/gordle),
[gorelease](https://github.com/nwillc/gorelease) or [gotimer](https://github.com/nwillc/gotimer).
## License
The code is under the [ISC License](https://github.com/nwillc/genfuncs/blob/master/LICENSE.md).
## Requirements
Build with Go 1.18+
## Getting
```bash
go get github.com/nwillc/genfuncs
```
# Packages
- [genfuncs](<#genfuncs>)
- [genfuncs/container](<#container>)
- [genfuncs/container/gmaps](<#gmaps>)
- [genfuncs/container/gslices](<#gslices>)
- [genfuncs/container/sequences](<#sequences>)
- [genfuncs/promises](<#promises>)
- [genfuncs/results](<#results>)
repository:
url: https://github.com/nwillc/genfuncs
defaultBranch: master
path: /