github.com/octohelm/cuemod@v0.9.4/pkg/modutil/revinfo_test.go (about)

     1  package modutil
     2  
     3  import (
     4  	"context"
     5  	"fmt"
     6  	"os"
     7  	"testing"
     8  
     9  	"golang.org/x/mod/module"
    10  )
    11  
    12  func TestRevInfoFromDir(t *testing.T) {
    13  	cwd, _ := os.Getwd()
    14  	info, err := RevInfoFromDir(context.Background(), cwd)
    15  	if err != nil {
    16  		t.Fatal(err)
    17  	}
    18  	fmt.Println(info.Version)
    19  	fmt.Println(module.PseudoVersionBase(info.Version))
    20  }