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

Predict completion for go mod edit -replace #82

Closed
wants to merge 3 commits into from

Conversation

millergarym
Copy link

Code needs a tidy up (too many nested ifs).

Completes go mod edit -replace old@oldv=new@newv.

old is populated from go mod edt -json

oldv not implemented

new if path (~ or ../ or /) then walks the directories looking for go.mod, checks that the module if equals old adds it to the predictions.

new if no path then used the github api to get list of forked projects.

newv is currently only set to master.

return nil
}
data, _ := json.Marshal(&fkd)
ioutil.WriteFile(fmt.Sprintf("%s/go-gomod-replace-dsts-%d", os.TempDir(), ppid), data, os.ModePerm)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Error return value of ioutil.WriteFile is not checked (from errcheck)

if err != nil {
log.Printf("regex err %v\n", err)
} else {
err = filepath.Walk(fd.Name(), func(path string, info os.FileInfo, err error) error {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ineffectual assignment to err (from ineffassign)

@posener
Copy link
Owner

posener commented Feb 20, 2019

Is this WIP?

@posener
Copy link
Owner

posener commented Apr 26, 2019

Since there was no reply, I'm closing this. Please reopen if still relevant.

@posener posener closed this Apr 26, 2019
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

Successfully merging this pull request may close these issues.

4 participants