-
Notifications
You must be signed in to change notification settings - Fork 42
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
Go tutorial and reference #723
base: main
Are you sure you want to change the base?
Conversation
fa851bb
to
47903ac
Compare
47903ac
to
e74cf0c
Compare
|
||
.. note:: | ||
|
||
``rockcraft pack`` will create a new image with the updated code even if you |
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.
Nitpick: Should this pack command have ROCKCRAFT_ENABLE_EXPERIMENTAL_EXTENSIONS
included in it?
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.
Not sure about that, the command to run is just below this line (with the correct env var set). I think this is referring to the generic "rockcraft pack". What do you think?
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.
Looked at the tutorial, I think it is a good start
docs/tutorial/go.rst
Outdated
:dedent: 2 | ||
|
||
|
||
Add another binary to the Go application |
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.
A lot of the other tutorials demonstrate how to update the application? I think this is fine to include perhaps as another step since we don't have the chisel anyway?
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.
replied in the next comment.
docs/tutorial/go.rst
Outdated
Add the following snippet to the file ``rockcraft.yaml``, so the new binary is | ||
set as the main application to run: |
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.
Hmm, I don't follow why we would suggest the user does this?
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.
I did this because I think it is one of the pain points of the extension. Many Go projects have the binaries under cmd/, sometimes being one the server and the other ones could be for example command line tools.
I put this example to show how to use another binary, and at the same time how to "update" the application, put another version of the rock... Would you suggest another different example to update the app?
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.
Perhaps that can be a separate how to. I would suggest just showing perhaps adding another endpoint like the time endpoint on other tutorials
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.
I think the tutorial doesn’t flow, it doesn’t make sense at least to me that I would want to add another binary at this point, I probably would just want to add some features
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.
sure, let me try that way (adding another endpoint) and I will leave that part for a how-to (I think it is important).
I will copy the flask endpoint in Go
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.
Done!
docs/tutorial/go.rst
Outdated
for you. | ||
|
||
By default, the ``go-framework`` will use the ``bare`` base. You can improve | ||
the developer experience changing the base to ``[email protected]``, but the |
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.
Could we caveat what we mean by this? E.g., for debugging it might be better to use but for production we recommend bare?
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.
I have rephrased it a bit. I think it is a bit clearer now.
docs/tutorial/code/go/main.go.time
Outdated
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.
perhaps rename this to main-time.go so that the editors recognise it as a go file?
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.
I did not use the .go
extension because otherwise it will be compiled (and will fail).
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.
Ah ok makes sense
Adds a tutorial and reference docs for the Go extension