v0.0.0-...-9d99875 Latest Latest

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

Go to latest
Published: Oct 24, 2021 License: GPL-2.0 Imports: 12 Imported by: 0



Package generate The purpose of this package is to ensure that we can extend the use-case of P2PRC. We will create a project directory with the template to extend the use-case of P2PRC



This section is empty.


This section is empty.


func CreateFolder

func CreateFolder(name string, path string) error

CreateFolder Creates a new folder based on the name and path provided

func GenerateNewProject

func GenerateNewProject(name string, module string) error

GenerateNewProject creates a new copy of the P2PRC project for custom modification

func TestCaseAST

func TestCaseAST()


type NewProject

type NewProject struct {
	Name          string
	Module        string
	NewDir        string
	P2PRCPath     string
	CurrentModule string
	Option        *copy.Options
	Token         *token.FileSet
	AST           *ast.File
	FileNameAST   string

NewProject Struct information required when creating a new project

func (*NewProject) ChangeImportFiles

func (a *NewProject) ChangeImportFiles() error

ChangeImportFiles Changes Appropriate imports in the appropriate file

func (*NewProject) ChangeImports

func (np *NewProject) ChangeImports(CurrentImport string, ChangedImport string) error

ChangeImports Changes import of the AST

func (*NewProject) CreateGoMod

func (a *NewProject) CreateGoMod() error

CreateGoMod Creates a new go module for the new project created

func (*NewProject) CreateGoModTidy

func (a *NewProject) CreateGoModTidy() error

func (*NewProject) GetASTGoFile

func (np *NewProject) GetASTGoFile() error

GetASTGoFile Gets AST of the Go file provided

func (*NewProject) GetCurrentGoModule

func (a *NewProject) GetCurrentGoModule() error

GetCurrentGoModule Gets the current go module name

func (*NewProject) GitAdd

func (a *NewProject) GitAdd() error

func (*NewProject) GitCommit

func (a *NewProject) GitCommit() error

func (*NewProject) WriteGoAst

func (np *NewProject) WriteGoAst() error

WriteGoAst Write changed imports back to the AST

Jump to

Keyboard shortcuts

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