Skip to content

Commit

Permalink
v11 type parameters & Go 1.18 mitigations (#21)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
seborama committed Mar 30, 2022
1 parent 6203c12 commit b40d55e
Show file tree
Hide file tree
Showing 71 changed files with 2,305 additions and 8,477 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,5 @@
/.history/
/research/
research_*

/bin
52 changes: 13 additions & 39 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,37 +15,6 @@ run:
# include test files or not, default is true
tests: false

# list of build tags, all linters use it. Default is empty list.
build-tags:
# - mytag

# which dirs to skip: they won't be analyzed;
# can use regexp here: generated.*, regexp is applied on full path;
# default value is empty list, but next dirs are always skipped independently
# from this option's value:
# vendor$, third_party$, testdata$, examples$, Godeps$, builtin$
skip-dirs:
#- src/research

# which files to skip: they will be analyzed, but issues from them
# won't be reported. Default value is empty list, but there is
# no need to include all autogenerated files, we confidently recognize
# autogenerated files. If it's not please let us know.
skip-files:
#- ".*\\.my\\.go$"
#- lib/bad.go

# by default isn't set. If set we pass it to "go list -mod={option}". From "go help modules":
# If invoked with -mod=readonly, the go command is disallowed from the implicit
# automatic updating of go.mod described above. Instead, it fails when any changes
# to go.mod are needed. This setting is most useful to check that go.mod does
# not need updates, such as in a continuous integration and testing system.
# If invoked with -mod=vendor, the go command assumes that the vendor
# directory holds the correct copies of dependencies and ignores
# the dependency descriptions in go.mod.
#modules-download-mode: readonly|release|vendor


# output configuration options
output:
# colored-line-number|line-number|json|tab|checkstyle|code-climate, default is "colored-line-number"
Expand Down Expand Up @@ -115,7 +84,7 @@ linters-settings:
# Setting locale to US will correct the British spelling of 'colour' to 'color'.
locale: UK
ignore-words:
#- someword
- fuego
lll:
# max line length, lines longer will be reported. Default is 120.
# '\t' is counted as 1 character by default, and can be changed with the tab-width option
Expand Down Expand Up @@ -170,17 +139,22 @@ linters-settings:
# sizeThreshold: 32

linters:
#enable:
# - megacheck
# - govet
# - maligned
# - golint
# enable:
# - cyclop
# - gocognit
# - gocyclo
# - goerr113
# - gofmt
# - golint
# - ifshort
# - megacheck
enable-all: true
disable:
- gomnd
- forcetypeassert
- ireturn
- lll
- nlreturn
- wsl
- varnamelen
disable-all: false
#presets:
# - bugs
Expand Down
15 changes: 10 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,24 @@ endif

.PHONY: deps
deps:
go get -d -t -v ./...
go mod tidy && go mod download

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

.PHONY: generate
generate: deps
go build -o bin/maptoXXX ./generate/maptoXXX.go
go generate

.PHONY: lint
lint: deps
@echo "=~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~="
./golangci-lint.sh

.PHONY: mutations
mutations: deps
@echo "=~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~="
./gomutesting.sh
# .PHONY: mutations
# mutations: deps
# @echo "=~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~="
# ./gomutesting.sh

Loading

0 comments on commit b40d55e

Please sign in to comment.