Files
zeekay fa64f27ed2 fix(lint): replace magic strings with constants for goconst compliance
Add package-level constants for repeated string literals across the codebase:
- LuxEVMName in deploy.go for VM naming
- MainnetSubnetBlockchainID in start_with_state.go
- PChainID in chain/config.go
- pqSuffix, schemeLSAG, schemeLattice, schemeLatticeFull, schemeLatticePQ in keycmd
- rentalPlan* and validatorMgmtHybrid in l1cmd/migrate.go
- vmType* constants in l3cmd/create.go
- networkTypeCustom, networkTypeLocal in networkcmd
- vmNameEVM, orgLuxfi in vmcmd
- WalletConnectName in key package
- platformDarwin in backend_test.go
- strTrue in e2e tests

This addresses all goconst linter warnings requiring string literals
with 3+ occurrences to be defined as constants.
2026-01-02 05:05:58 -08:00

28 lines
815 B
Go

// Copyright (C) 2022-2025, Lux Industries Inc. All rights reserved.
// See the file LICENSE for licensing terms.
package commands
import (
"encoding/json"
"net/http"
"github.com/onsi/gomega"
)
const luxdReleaseURL = "https://api.github.com/repos/luxfi/luxd/releases/latest"
func GetLatestLuxdVersionFromGithub() string {
response, err := http.Get(luxdReleaseURL)
gomega.Expect(err).Should(gomega.BeNil())
defer func() { _ = response.Body.Close() }()
gomega.Expect(response.StatusCode).Should(gomega.BeEquivalentTo(http.StatusOK))
var releaseInfo map[string]interface{}
decoder := json.NewDecoder(response.Body)
err = decoder.Decode(&releaseInfo)
gomega.Expect(err).Should(gomega.BeNil())
tagName, ok := releaseInfo["tag_name"].(string)
gomega.Expect(ok).Should(gomega.BeTrue())
return tagName
}