robertmu commented on code in PR #69:
URL: https://github.com/apache/cloudberry-backup/pull/69#discussion_r2875635201
##########
plugins/s3plugin/backup.go:
##########
@@ -40,6 +40,15 @@ func SetupPluginForBackup(c *cli.Context) error {
return err
}
+func VersionCommand(c *cli.Context) error {
Review Comment:
It appears that VersionCommand is currently not being called anywhere. To
keep the codebase clean, I think that we should remove it if it's not strictly
necessary.
The function currently sets a default value of "dev" if the version is
empty. It's generally better to avoid setting such defaults in the code. If the
build system fails to inject the version (via ldflags), it should be treated as
a bug in the build/CI process rather than being masked by a fallback value in
the source code.
##########
plugins/s3plugin/s3plugin.go:
##########
@@ -28,7 +28,10 @@ import (
"gopkg.in/yaml.v2"
)
-var Version string
+var (
+ version string // This will be set by ldflags
+ Version = version // Public alias
+)
Review Comment:
Instead of maintaining both an unexported version and an exported Version
variable, a cleaner approach would be to follow the pattern used in gpbackup
and gprestore. We can keep the version variable internal and provide a
GetVersion() function. This function can then be called by
gpbackup_s3_plugin.go to retrieve the version string
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]