Standard library / runtime/debug

debug.Module

Describes a module path, version, checksum and optional replacement in build metadata. Expected stdout: 'example.invalid/demo v1.0.0\n'.

Formal Syntax & Structure

go syntaxgo
type Module struct {  Path    string  Version string  Sum     string  Replace *Module}

Working Example

Example Snippetgo
package main
import (  "fmt"  "runtime/debug")
func main() {  m := debug.Module{Path: "example.invalid/demo", Version: "v1.0.0"}  fmt.Println(m.Path, m.Version)}
Go Reference