Skip to content

Conversation

NEKO-CwC
Copy link

@NEKO-CwC NEKO-CwC commented Mar 28, 2025

IMPORTANT: Because some of the llgo get code was manually merged locally, it is recommended to review after merging the pr llgo get.

Moreover, the llgo list is currently in a semi-finished stage.

Temporarily, three flags have been implemented according to the following plan.

  1. llgo list supports two types of input: one is a string without a / and the other is a complete module path.
    1. When brief input is provided, such as cjson, the llpkgstore module's metadata section is used to obtain the latest cached content and structure of llpkgstore.json, to determine if it is a clib. If it is, the complete module path github.com/goplus/llpkg/{clib} is concatenated.
    2. If it is a complete module path, the logic below is directly entered.
  2. The default behavior of llgo list is completely consistent with go list without any special flags.
  3. When using llgo list -m
    1. The default behavior before is completely consistent with go list, including the conditions for use, and this verification can be simply implemented through code.
    2. If the verification is successful, you can enter the normal module list. At this point, you can concatenate the complete module path through environment variables, and if there is an llpkg.cfg in this path, identify it as LLPkg. When outputting, combine it with corresponding upstream information and the current version.
    3. If there is none, treat it as the default go module and fallback to go list for output.
  4. When using llgo list -m -versions (there are two cases at this point, please write two different methods and put them in two files)
    1. Obtain the latest cached content and structure of llpkgstore.json through the metadata section of the llpkgstore module, and directly obtain the required version content by concatenating the methods here.
    2. For official llpkg, obtain the original file for upstream information acquisition by concatenating the address https://{module/path}/tree/{tag[vclib/version]}/{clib}/llpkg.cfg.
  5. When using llgo list -json, simply inherit the flag to perform go list, then read the output into a structure, add the LLPkg field, and place the corresponding llpkg.cfg from the source code in it.

// Cmd 定义list命令
var Cmd = &base.Command{
UsageLine: "llgo list [-m] [-versions] [-json] [packages]",
Short: "列出包、模块及其依赖的信息",
Copy link
Member

Choose a reason for hiding this comment

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

Only English is allowed in the code and comments.

Copy link
Author

Choose a reason for hiding this comment

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

done in latest commit

Copy link

qiniu-x bot commented Mar 28, 2025

[Git-flow] Hi @NEKO-CwC, There are some suggestions for your information:


Rebase suggestions

  • Following commits have duplicated messages

    feat: change comment and output into english & delete upstream info

    feat: change comment and output into english & delete upstream info

Which seems insignificant, recommend to use git rebase command to reorganize your PR.

For other git-flow instructions, recommend refer to these examples.

If you have any questions about this comment, feel free to raise an issue here:

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.

2 participants