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

Several fixes for XenServer SDK for Go #5687

Merged

Conversation

minglumlu
Copy link
Member

Based on the comments in #5679, following changes are in this series:

  1. Fix phrasing in readme
  2. Add licence text on top of Go source files
  3. Remove template variables 'first' and 'is_session_id'

Signed-off-by: Ming Lu <ming.lu@cloud.com>
Signed-off-by: Ming Lu <ming.lu@cloud.com>
Signed-off-by: Ming Lu <ming.lu@cloud.com>
Prior to this change, the function parameter list is generated by
Mustache template. As a result, a template boolean variable 'first' has
to be used to determine if a leading comma is presented or not. E.g.
when the 'first' is true, a parameter would be rendered as "a string',
and then the next parameter with the 'first' being false would be
rendered as ", b string". Putting them together would result in
"a string, b string".

This could work but is difficult to be understood.

In this commit, it is changed to construct the whole function parameter
list as a string in OCaml code and bind it to the template variable
'func_params'.

Similar changes apply to the template variable 'is_session_id'. It is
removed in this commit and the expected values are generated by OCaml
code.

Signed-off-by: Ming Lu <ming.lu@cloud.com>
Signed-off-by: Ming Lu <ming.lu@cloud.com>
@@ -8,10 +8,10 @@
{{#errors}}
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't see a licence placeholder in this file or SessionMethod.mustache, was it forgotten?

Copy link
Contributor

Choose a reason for hiding this comment

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

The license placeholder is added in FileHeader.mustache. This header is for all generated .go files except jsonrpc_client.go

Copy link
Contributor

Choose a reason for hiding this comment

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

I checked all generated .go files, all contained the license in file header.

@minglumlu minglumlu merged commit cca5a6e into xapi-project:feature/go_sdk Jun 14, 2024
14 checks passed
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.

None yet

4 participants