Comment out unused code

Signed-off-by: Joel Longtine <joel@dagger.io>
This commit is contained in:
Joel Longtine 2022-02-18 16:26:51 -07:00
parent cdde074d09
commit a839ab124a
2 changed files with 33 additions and 37 deletions

View File

@ -2,11 +2,8 @@ package common
import ( import (
"context" "context"
"crypto/sha256"
"fmt"
"strings" "strings"
"github.com/go-git/go-git/v5"
"github.com/spf13/cobra" "github.com/spf13/cobra"
"go.dagger.io/dagger/telemetry" "go.dagger.io/dagger/telemetry"
) )
@ -32,27 +29,27 @@ func commandName(cmd *cobra.Command) string {
} }
// hash returns the sha256 digest of the string // hash returns the sha256 digest of the string
func hash(s string) string { // func hash(s string) string {
return fmt.Sprintf("%x", sha256.Sum256([]byte(s))) // return fmt.Sprintf("%x", sha256.Sum256([]byte(s)))
} // }
// gitRepoURL returns the git repository remote, if any. // // gitRepoURL returns the git repository remote, if any.
func gitRepoURL(path string) string { // func gitRepoURL(path string) string {
repo, err := git.PlainOpenWithOptions(path, &git.PlainOpenOptions{ // repo, err := git.PlainOpenWithOptions(path, &git.PlainOpenOptions{
DetectDotGit: true, // DetectDotGit: true,
}) // })
if err != nil { // if err != nil {
return "" // return ""
} // }
origin, err := repo.Remote("origin") // origin, err := repo.Remote("origin")
if err != nil { // if err != nil {
return "" // return ""
} // }
if urls := origin.Config().URLs; len(urls) > 0 { // if urls := origin.Config().URLs; len(urls) > 0 {
return urls[0] // return urls[0]
} // }
return "" // return ""
} // }

View File

@ -8,7 +8,6 @@ import (
"go.dagger.io/dagger/client" "go.dagger.io/dagger/client"
"go.dagger.io/dagger/cmd/dagger/cmd/common" "go.dagger.io/dagger/cmd/dagger/cmd/common"
"go.dagger.io/dagger/cmd/dagger/logger" "go.dagger.io/dagger/cmd/dagger/logger"
"go.dagger.io/dagger/mod"
"go.dagger.io/dagger/plan" "go.dagger.io/dagger/plan"
"go.dagger.io/dagger/solver" "go.dagger.io/dagger/solver"
"golang.org/x/term" "golang.org/x/term"
@ -61,20 +60,20 @@ var upCmd = &cobra.Command{
}, },
} }
func checkUniverseVersion(ctx context.Context, projectPath string) bool { // func checkUniverseVersion(ctx context.Context, projectPath string) bool {
lg := log.Ctx(ctx) // lg := log.Ctx(ctx)
isLatest, err := mod.IsUniverseLatest(ctx, projectPath) // isLatest, err := mod.IsUniverseLatest(ctx, projectPath)
if err != nil { // if err != nil {
lg.Debug().Err(err).Msg("failed to check universe version") // lg.Debug().Err(err).Msg("failed to check universe version")
return false // return false
} // }
if !isLatest { // if !isLatest {
return true // return true
} // }
lg.Debug().Msg("universe is up to date") // lg.Debug().Msg("universe is up to date")
return false // return false
} // }
func europaUp(ctx context.Context, cl *client.Client, args ...string) error { func europaUp(ctx context.Context, cl *client.Client, args ...string) error {
lg := log.Ctx(ctx) lg := log.Ctx(ctx)