gomodfile

package module
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 23, 2022 License: Apache-2.0 Imports: 7 Imported by: 0

README

gomodfile

Detect directory is Go project

Installation

go get -u github.com/coolstina/gomodfile

Example

package main

import (
	"fmt"
	"log"

	"github.com/coolstina/gomodfile"
)

func main() {
	goProject, err := gomodfile.IsGoProject()
	if err != nil {
		log.Fatalf("can't get current directory is Go project")
	}

	if !goProject {
		log.Printf("get current directory is not Go project")
		return
	}

	fmt.Printf("get current directory is Go project")
}
get current directory is Go project

Documentation

Index

Constants

View Source
const GoModuleFilename = "go.mod"

Variables

This section is empty.

Functions

func IsGoProject

func IsGoProject() (bool, error)

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL