// Runs 'go list -m' command and returns module name
Runs 'go list -m' command and returns module name
// Runs ' go list - m ' command and returns module name
func GetModuleNameByDir(projectDir string, log Log) (string, error) {
	if log == nil {
		log = &NullLog{}
	}
	cmdArgs, err := getListCmdArgs()
	if err != nil {
		return "", err
	}
	cmdArgs = append(cmdArgs, "-m")
	output, err := runDependenciesCmd(projectDir, cmdArgs, log)
	if err != nil {
		return "", err
	}
	lineOutput := strings.Split(output, "\n")
	return lineOutput[0], err
}
func GetModuleNameByDir ( projectDir string , log Log ) ( string , error ) { if log == nil { log = & NullLog { } } cmdArgs , err := getListCmdArgs ( ) if err != nil { return " " , err } cmdArgs = append ( cmdArgs , " " ) output , err := runDependenciesCmd ( projectDir , cmdArgs , log ) if err != nil { return " " , err } lineOutput := strings . Split ( output , " \n " ) return lineOutput [ 0 ] , err }
Runs 'go list -m' command and returns module name
Runs ' go list - m ' command and returns module name