Source File
latest.go
Belonging Package
golang.org/x/pkgsite/internal
package internal
import (
)
type LatestModuleVersions struct {
ModulePath string
RawVersion string // ignoring retractions
CookedVersion string // considering retractions
GoodVersion string // successfully processed
GoModFile *modfile.File // of raw
Deprecated bool
deprecationComment string
}
func (, , , string, []byte) (*LatestModuleVersions, error) {
, := modfile.ParseLax(fmt.Sprintf("%s@%s/go.mod", , ), , nil)
if != nil {
return nil,
}
, := isDeprecated()
return &LatestModuleVersions{
ModulePath: ,
RawVersion: ,
CookedVersion: ,
GoodVersion: ,
GoModFile: ,
Deprecated: ,
deprecationComment: ,
}, nil
}
func ( *modfile.File) (bool, string) {
const = "Deprecated:"
if .Module == nil {
return false, ""
}
for , := range append(.Module.Syntax.Before, .Module.Syntax.Suffix...) {
:= strings.TrimSpace(strings.TrimPrefix(.Token, "//"))
if strings.HasPrefix(, ) {
return true, strings.TrimSpace([len():])
}
}
return false, ""
}
func ( *LatestModuleVersions) ( *ModuleInfo) {
.Deprecated = .Deprecated
.DeprecationComment = .deprecationComment
.Retracted, .RetractionRationale = isRetracted(.GoModFile, .Version)
}
func ( *LatestModuleVersions) ( string) bool {
, := isRetracted(.GoModFile, )
return
}
![]() |
The pages are generated with Golds v0.3.2-preview. (GOOS=darwin GOARCH=amd64) Golds is a Go 101 project developed by Tapir Liu. PR and bug reports are welcome and can be submitted to the issue list. Please follow @Go100and1 (reachable from the left QR code) to get the latest news of Golds. |