-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
feat: add version deps command [modversion] #6115
Conversation
Kubuxu
commented
Mar 21, 2019
•
edited
Loading
edited
- Tests
return nil | ||
}, | ||
Encoders: cmds.EncoderMap{ | ||
cmds.Text: cmds.MakeTypedEncoder(func(req *cmds.Request, w io.Writer, dep Dependency) error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For some reason, if I change Dependency
to *Dependency
here I get no output, no error and the encoder is not being run (tested with panic
).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Stebalien this requires us to bump to Go1.12, is that ok? |
return nil | ||
}, | ||
Encoders: cmds.EncoderMap{ | ||
cmds.Text: cmds.MakeTypedEncoder(func(req *cmds.Request, w io.Writer, dep Dependency) error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
core/commands/version.go
Outdated
fmt.Fprintf(w, " => %s", dep.ReplacedBy) | ||
} | ||
fmt.Fprintf(w, "\n") | ||
return errors.New("test") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
foobar
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like this error gets ignored. Interesting.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
diff --git a/core/commands/version.go b/core/commands/version.go
index 9c5c666d0..c9632f799 100644
--- a/core/commands/version.go
+++ b/core/commands/version.go
@@ -118,9 +118,13 @@ Print out all dependencies and their versions.`,
}
return
}
- res.Emit(toDependency(&info.Main))
+ if err := res.Emit(toDependency(&info.Main)); err != nil {
+ return err
+ }
for _, dep := range info.Deps {
- res.Emit(toDependency(dep))
+ if err := res.Emit(toDependency(dep)); err != nil {
+ return err
+ }
}
return nil
},
@Kubuxu personally, I'm fine with a go 1.12 bump. Non-buggy go modules require that as well. Other comment: needs test. |
core/commands/version.go
Outdated
fmt.Fprintf(w, " => %s", dep.ReplacedBy) | ||
} | ||
fmt.Fprintf(w, "\n") | ||
return errors.New("test") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
diff --git a/core/commands/version.go b/core/commands/version.go
index 9c5c666d0..c9632f799 100644
--- a/core/commands/version.go
+++ b/core/commands/version.go
@@ -118,9 +118,13 @@ Print out all dependencies and their versions.`,
}
return
}
- res.Emit(toDependency(&info.Main))
+ if err := res.Emit(toDependency(&info.Main)); err != nil {
+ return err
+ }
for _, dep := range info.Deps {
- res.Emit(toDependency(dep))
+ if err := res.Emit(toDependency(dep)); err != nil {
+ return err
+ }
}
return nil
},
@Kubuxu we'll also need to update the go version in CI. |
I know, just didn't have time to handle it today. |
License: MIT Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch>
License: MIT Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch>
This is ready. |
Wait with it, I've done something weird in sharness. |
License: MIT Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch>
I think it is done. |
It is ready. |