Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cloud not import github.com/jucardi/go-streams/streams/v2 #12

Open
voidint opened this issue Aug 1, 2023 · 1 comment
Open

cloud not import github.com/jucardi/go-streams/streams/v2 #12

voidint opened this issue Aug 1, 2023 · 1 comment

Comments

@voidint
Copy link

voidint commented Aug 1, 2023

$ go version
go version go1.20.6 darwin/arm64
  • step1
$ mkdir teststream && cd teststream  &&  go mod init github.com/voidint/teststream && touch main.go
  • step2
package main

import (
	"fmt"
	"strings"

	"github.com/jucardi/go-streams/streams/v2"
)

func main() {
	var fruitArray = []string{"peach", "apple", "pear", "plum", "pineapple", "banana", "kiwi", "orange"}

	fmt.Println(streams.
		// Creates a stream from the given array
		From[string](fruitArray).
		// Adds a filter for strings that start with 'p'
		Filter(func(v string) bool {
			return strings.HasPrefix(v, "p")
		}).
		// Sorts alphabetically
		Sort(strings.Compare).
		// Converts back to an array
		ToArray(),
	)
}
  • step3
$ go get github.com/jucardi/go-streams/streams/v2@latest
$ go mod tidy 
go: finding module for package github.com/jucardi/go-streams/streams/v2
github.com/voidint/teststream imports
        github.com/jucardi/go-streams/streams/v2: module github.com/jucardi/go-streams@latest found (v1.0.3), but does not contain package github.com/jucardi/go-streams/streams/v2

$ cat go.mod
module github.com/voidint/teststream

go 1.20

require github.com/jucardi/go-streams/v2 v2.0.1 // indirect
@voidint
Copy link
Author

voidint commented Aug 1, 2023

I have cleared the cache: go clean -modcache

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant