util

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Comments = []string{

	`//.*[\n\r]`,

	`/\*[\s\S]*\*/`,
}

rules for matching comments

Functions

func Explode

func Explode(value string) *[]string

split a string into segments

func FileExists

func FileExists(path string) bool

check whether a file exists

func FullPath

func FullPath(file string, base string, replacers *map[string]string) string

generate a full path of an imported file

func LocateImports

func LocateImports(prefix *string, code *string) []string

find all occurences/usage of an imported module/package

func Preprocess

func Preprocess(code string, rules *[]string) string

func TraverseDirectory

func TraverseDirectory(root *string, extensions *[]string, ignoredPaths *[]string) (*[]File, error)

recursively list of all files in a directory

Types

type File

type File struct {
	Path string
	Code string
}

Jump to

Keyboard shortcuts

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