fix(Compile): Fixed error "<module> is not in GOROOT"

This commit is contained in:
netbenix 2022-08-27 19:08:57 +02:00
parent cbbe886dbb
commit 39a136dc50
4 changed files with 35 additions and 30 deletions

View file

@ -1,34 +1,33 @@
package ProtoHandler
import (
proto "lotus-pm.net/proto"
"lpm-cli/Lotus"
proto "lpm-cli/Proto/lpm/go"
)
type Package struct{
type Package struct {
PackageMetadata PackageMetadata
Register Lotus.Registry
Register Lotus.Registry
}
type PackageMetadata struct {
Publisher string
Name string
Version string
Description string
Tags []string
Labels map[string]string
PackageSize uint64
Checksums Checksums
Platform string
Publisher string
Name string
Version string
Description string
Tags []string
Labels map[string]string
PackageSize uint64
Checksums Checksums
Platform string
Architecture string
Dependencies []Dependency
}
func fillDependencies(protoDependency []*proto.Dependency) []Dependency {
dependencies := make([]Dependency, len(protoDependency))
for i, dep := range protoDependency{
for i, dep := range protoDependency {
dependencies[i].ID = dep.GetId()
dependencies[i].VersionFilter = dep.GetVersionFilter()
}
@ -39,12 +38,16 @@ func fillDependencies(protoDependency []*proto.Dependency) []Dependency {
func fillChecksums(checksum []*proto.Checksum) Checksums {
checksums := Checksums{}
for i, chk := range checksum{
switch checksum[i].Algorithm{
case 0: checksums.MD5 = chk.Checksum
case 1: checksums.SHA1 = chk.Checksum
case 2: checksums.SHA256 = chk.Checksum
case 3: checksums.SHA512 = chk.Checksum
for i, chk := range checksum {
switch checksum[i].Algorithm {
case 0:
checksums.MD5 = chk.Checksum
case 1:
checksums.SHA1 = chk.Checksum
case 2:
checksums.SHA256 = chk.Checksum
case 3:
checksums.SHA512 = chk.Checksum
}
}
@ -63,4 +66,4 @@ func (pkgMeta *PackageMetadata) FillMetadata(protoData *proto.PackageMetadata) {
pkgMeta.Platform = protoData.Platform
pkgMeta.Architecture = protoData.Architecture
pkgMeta.Dependencies = fillDependencies(protoData.GetDependencies())
}
}