Skip to content

Commit b40d55e

Browse files
authored
v11 type parameters & Go 1.18 mitigations (#21)
* v11: transition to go 1.18 type parameters (WIP) * add interface implementation checks * Checkpoint * Initial ground zero * Some updates to README (WIP) * Makefile * added common type aliases and improved tests * more tests, tweaks * re-org'ed files * FlatMap also fix go.mod versioning * add Predicate * added: predicate, stream.Filter * added TestStream_ForEach * doc updates * added Stream.MapTo* generated code * added: LeftReduce, Reduce and BiFunctions: Max, Min, Sum * README, renamed a param * Licence file * README * refined generated code (adding FlatMapTo* as well) * added tests * add ComparableStream with Max and Min * add ComparableStream.Sum * test branch for Issue 51957 See golang/go#51957 * Attempt to move forward with Go 1.18 * Add Average, replace Addable with Mathable Small corrections * added Stream.GroupBy * added collectors * added missing test * README updates * add optional + more collectors, etc
1 parent 6203c12 commit b40d55e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

71 files changed

+2305
-8477
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,5 @@
1515
/.history/
1616
/research/
1717
research_*
18+
19+
/bin

.golangci.yml

Lines changed: 13 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -15,37 +15,6 @@ run:
1515
# include test files or not, default is true
1616
tests: false
1717

18-
# list of build tags, all linters use it. Default is empty list.
19-
build-tags:
20-
# - mytag
21-
22-
# which dirs to skip: they won't be analyzed;
23-
# can use regexp here: generated.*, regexp is applied on full path;
24-
# default value is empty list, but next dirs are always skipped independently
25-
# from this option's value:
26-
# vendor$, third_party$, testdata$, examples$, Godeps$, builtin$
27-
skip-dirs:
28-
#- src/research
29-
30-
# which files to skip: they will be analyzed, but issues from them
31-
# won't be reported. Default value is empty list, but there is
32-
# no need to include all autogenerated files, we confidently recognize
33-
# autogenerated files. If it's not please let us know.
34-
skip-files:
35-
#- ".*\\.my\\.go$"
36-
#- lib/bad.go
37-
38-
# by default isn't set. If set we pass it to "go list -mod={option}". From "go help modules":
39-
# If invoked with -mod=readonly, the go command is disallowed from the implicit
40-
# automatic updating of go.mod described above. Instead, it fails when any changes
41-
# to go.mod are needed. This setting is most useful to check that go.mod does
42-
# not need updates, such as in a continuous integration and testing system.
43-
# If invoked with -mod=vendor, the go command assumes that the vendor
44-
# directory holds the correct copies of dependencies and ignores
45-
# the dependency descriptions in go.mod.
46-
#modules-download-mode: readonly|release|vendor
47-
48-
4918
# output configuration options
5019
output:
5120
# colored-line-number|line-number|json|tab|checkstyle|code-climate, default is "colored-line-number"
@@ -115,7 +84,7 @@ linters-settings:
11584
# Setting locale to US will correct the British spelling of 'colour' to 'color'.
11685
locale: UK
11786
ignore-words:
118-
#- someword
87+
- fuego
11988
lll:
12089
# max line length, lines longer will be reported. Default is 120.
12190
# '\t' is counted as 1 character by default, and can be changed with the tab-width option
@@ -170,17 +139,22 @@ linters-settings:
170139
# sizeThreshold: 32
171140

172141
linters:
173-
#enable:
174-
# - megacheck
175-
# - govet
176-
# - maligned
177-
# - golint
142+
# enable:
143+
# - cyclop
144+
# - gocognit
145+
# - gocyclo
146+
# - goerr113
147+
# - gofmt
148+
# - golint
149+
# - ifshort
150+
# - megacheck
178151
enable-all: true
179152
disable:
180-
- gomnd
153+
- forcetypeassert
154+
- ireturn
181155
- lll
182156
- nlreturn
183-
- wsl
157+
- varnamelen
184158
disable-all: false
185159
#presets:
186160
# - bugs

Makefile

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,24 @@ endif
55

66
.PHONY: deps
77
deps:
8-
go get -d -t -v ./...
8+
go mod tidy && go mod download
99

1010
.PHONY: test
1111
test: deps
1212
go test -timeout 5s -cover $(GORACE) -parallel 100
1313

14+
.PHONY: generate
15+
generate: deps
16+
go build -o bin/maptoXXX ./generate/maptoXXX.go
17+
go generate
18+
1419
.PHONY: lint
1520
lint: deps
1621
@echo "=~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~="
1722
./golangci-lint.sh
1823

19-
.PHONY: mutations
20-
mutations: deps
21-
@echo "=~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~="
22-
./gomutesting.sh
24+
# .PHONY: mutations
25+
# mutations: deps
26+
# @echo "=~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~="
27+
# ./gomutesting.sh
2328

0 commit comments

Comments
 (0)