gop

package module
v1.2.0-pre.2 Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2024 License: Apache-2.0 Imports: 26 Imported by: 0

README

Build Status Go Report Card Coverage Status GitHub release Discord

The Go+ programming language is designed for engineering, STEM education, and data science.

  • For engineering: working in the simplest language that can be mastered by children.
  • For STEM education: studying an engineering language that can be used for work in the future.
  • For data science: communicating with engineers in the same language.

For more details, see Quick Start.

Key Features of Go+

How to install

on Windows

winget install goplus

Or

winget install goplus.gop

on Debian/Ubuntu

sudo bash -c ' echo "deb [trusted=yes] https://pkgs.goplus.org/apt/ /" > /etc/apt/sources.list.d/goplus.list'
sudo apt update
sudo apt install gop

on RedHat/CentOS/Fedora

sudo bash -c 'echo -e "[goplus]\nname=Go+ Repo\nbaseurl=https://pkgs.goplus.org/yum/\nenabled=1\ngpgcheck=0" > /etc/yum.repos.d/goplus.repo'
sudo yum install gop

on macOS/Linux(Homebrew)

Install via brew

$ brew install goplus

from source code

For now, we suggest you install Go+ from source code.

Note: Requires go1.18 or later

git clone https://github.com/goplus/gop.git
cd gop

# On mac/linux run:
./all.bash
# On Windows run:
all.bat

Go+ Applications

2D Games powered by Go+

DevOps tools

Data processing

IDE Plugins

Contributing

The Go+ project welcomes all contributors. We appreciate your help!

For more details, see Contributing & compiler design.

Give a Star! ⭐

If you like or are using Go+ to learn or start your projects, please give it a star. Thanks!

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotFound      = syscall.ENOENT
	ErrIgnoreNotated = errors.New("notated error ignored")
)
View Source
var (
	ErrMultiPackges     = errors.New("multiple packages")
	ErrMultiTestPackges = errors.New("multiple test packages")
)

Functions

func BuildDir added in v1.1.0

func BuildDir(dir string, conf *Config, build *gocmd.BuildConfig) (err error)

BuildDir builds a Go+ package directory. if conf != nil && conf.Context == nil, it will be set with `gox.NewContext()`.

func BuildFiles added in v1.1.0

func BuildFiles(files []string, conf *Config, build *gocmd.BuildConfig) (err error)

BuildFiles builds specified Go+ files. if conf != nil && conf.Context == nil, it will be set with `gox.NewContext()`.

func BuildPkgPath added in v1.1.0

func BuildPkgPath(workDir, pkgPath string, conf *Config, build *gocmd.BuildConfig) (err error)

BuildPkgPath builds a Go+ package. if conf != nil && conf.Context == nil, it will be set with `gox.NewContext()`.

func ErrorPos added in v1.1.10

func ErrorPos(err error) token.Pos

ErrorPos returns where the error occurs.

func GenGo added in v1.1.0

func GenGo(dir string, conf *Config, genTestPkg bool) (string, bool, error)

GenGo generates gop_autogen.go for a Go+ package directory. if conf != nil && conf.Context == nil, it will be set with `gox.NewContext()`.

func GenGoEx added in v1.1.8

func GenGoEx(dir string, conf *Config, genTestPkg bool, flags GenFlags) (string, bool, error)

GenGoEx generates gop_autogen.go for a Go+ package directory. if conf != nil && conf.Context == nil, it will be set with `gox.NewContext()`.

func GenGoFiles added in v1.1.0

func GenGoFiles(autogen string, files []string, conf *Config) (result []string, err error)

GenGoFiles generates gop_autogen.go for specified Go+ files. if conf != nil && conf.Context == nil, it will be set with `gox.NewContext()`.

func GenGoPkgPath added in v1.1.0

func GenGoPkgPath(workDir, pkgPath string, conf *Config, allowExtern bool) (localDir string, recursively bool, err error)

GenGoPkgPath generates gop_autogen.go for a Go+ package. if conf != nil && conf.Context == nil, it will be set with `gox.NewContext()`.

func GenGoPkgPathEx added in v1.1.8

func GenGoPkgPathEx(workDir, pkgPath string, conf *Config, allowExtern bool, flags GenFlags) (localDir string, recursively bool, err error)

GenGoPkgPathEx generates gop_autogen.go for a Go+ package. if conf != nil && conf.Context == nil, it will be set with `gox.NewContext()`.

func IgnoreNotated added in v1.1.10

func IgnoreNotated(err error) bool

IgnoreNotated returns if cause err is ErrIgnoreNotated or not.

func InstallDir added in v1.1.0

func InstallDir(dir string, conf *Config, install *gocmd.InstallConfig) (err error)

InstallDir installs a Go+ package directory. if conf != nil && conf.Context == nil, it will be set with `gox.NewContext()`.

func InstallFiles added in v1.1.0

func InstallFiles(files []string, conf *Config, install *gocmd.InstallConfig) (err error)

InstallFiles installs specified Go+ files. if conf != nil && conf.Context == nil, it will be set with `gox.NewContext()`.

func InstallPkgPath added in v1.1.0

func InstallPkgPath(workDir, pkgPath string, conf *Config, install *gocmd.InstallConfig) (err error)

InstallPkgPath installs a Go+ package. if conf != nil && conf.Context == nil, it will be set with `gox.NewContext()`.

func LoadDir added in v1.1.0

func LoadDir(dir string, conf *Config, genTestPkg bool, promptGenGo ...bool) (out, test *gox.Package, err error)

func LoadFiles added in v1.1.0

func LoadFiles(dir string, files []string, conf *Config) (out *gox.Package, err error)

func LoadMod added in v1.1.5

func LoadMod(dir string) (mod *gopmod.Module, err error)

func NotFound added in v1.1.2

func NotFound(err error) bool

NotFound returns if cause err is ErrNotFound or not

func Outline added in v1.1.8

func Outline(dir string, conf *Config) (out outline.Package, err error)

func OutlinePkgPath added in v1.1.8

func OutlinePkgPath(workDir, pkgPath string, conf *Config, allowExtern bool) (out outline.Package, err error)

func RunDir added in v1.1.0

func RunDir(dir string, args []string, conf *Config, run *gocmd.RunConfig) (err error)

RunDir runs an application from a Go+ package directory. if conf != nil && conf.Context == nil, it will be set with `gox.NewContext()`.

func RunFiles added in v1.1.0

func RunFiles(autogen string, files []string, args []string, conf *Config, run *gocmd.RunConfig) (err error)

RunFiles runs an application from specified Go+ files. if conf != nil && conf.Context == nil, it will be set with `gox.NewContext()`.

func RunPkgPath added in v1.1.0

func RunPkgPath(pkgPath string, args []string, chDir bool, conf *Config, run *gocmd.RunConfig) (err error)

RunPkgPath runs an application from a Go+ package. if conf != nil && conf.Context == nil, it will be set with `gox.NewContext()`.

func TestDir added in v1.1.0

func TestDir(dir string, conf *Config, test *gocmd.TestConfig) (err error)

TestDir tests a Go+ package directory. if conf != nil && conf.Context == nil, it will be set with `gox.NewContext()`.

func TestFiles added in v1.1.0

func TestFiles(files []string, conf *Config, test *gocmd.TestConfig) (err error)

TestFiles tests specified Go+ files. if conf != nil && conf.Context == nil, it will be set with `gox.NewContext()`.

func TestPkgPath added in v1.1.0

func TestPkgPath(workDir, pkgPath string, conf *Config, test *gocmd.TestConfig) (err error)

TestPkgPath tests a Go+ package. if conf != nil && conf.Context == nil, it will be set with `gox.NewContext()`.

func Tidy added in v1.1.0

func Tidy(dir string, gop *env.Gop) (err error)

Types

type Config added in v1.1.0

type Config struct {
	Gop      *env.Gop
	Fset     *token.FileSet
	Filter   func(fs.FileInfo) bool
	Importer types.Importer

	// Context represents all things between packages (optional).
	Context *gox.Context

	IgnoreNotatedError bool
}

type GenFlags added in v1.1.8

type GenFlags int
const (
	GenFlagCheckOnly GenFlags = 1 << iota
	GenFlagSingleFile
	GenFlagPrintError
	GenFlagPrompt
)

type Importer added in v1.1.0

type Importer struct {
	// contains filtered or unexported fields
}

func NewImporter added in v1.1.0

func NewImporter(mod *gopmod.Module, gop *env.Gop, fset *token.FileSet) *Importer

func (*Importer) Import added in v1.1.0

func (p *Importer) Import(pkgPath string) (pkg *types.Package, err error)

Directories

Path Synopsis
ast
Package ast declares the types used to represent syntax trees for Go+ packages.
Package ast declares the types used to represent syntax trees for Go+ packages.
mod
iox
ng
cl
Package cl compiles Go+ syntax trees (ast).
Package cl compiles Go+ syntax trees (ast).
cmd
gop command
gopfmt command
goptestgo command
internal/base
Package base defines shared basic pieces of the gop command, in particular logging and the Command structure.
Package base defines shared basic pieces of the gop command, in particular logging and the Command structure.
internal/build
Package build implements the “gop build” command.
Package build implements the “gop build” command.
internal/gengo
Package gengo implements the “gop go” command.
Package gengo implements the “gop go” command.
internal/gopfmt
Package gopfmt implements the “gop fmt” command.
Package gopfmt implements the “gop fmt” command.
internal/help
Package help implements the “gop help” command.
Package help implements the “gop help” command.
internal/install
Package install implements the “gop install” command.
Package install implements the “gop install” command.
internal/mod
* Copyright (c) 2021 The GoPlus Authors (goplus.org).
* Copyright (c) 2021 The GoPlus Authors (goplus.org).
internal/run
Package run implements the “gop run” command.
Package run implements the “gop run” command.
internal/serve
Package serve implements the “gop serve command.
Package serve implements the “gop serve command.
internal/test
Package test implements the “gop test” command.
Package test implements the “gop test” command.
Package format implements standard formatting of Go+ source.
Package format implements standard formatting of Go+ source.
Package parser implements a parser for Go+ source files.
Package parser implements a parser for Go+ source files.
fsx
Package printer implements printing of AST nodes.
Package printer implements printing of AST nodes.
Package scanner implements a scanner for Go+ source text.
Package scanner implements a scanner for Go+ source text.
Package token defines constants representing the lexical tokens of the Go+ programming language and basic operations on tokens (printing, predicates).
Package token defines constants representing the lexical tokens of the Go+ programming language and basic operations on tokens (printing, predicates).
Package watcher monitors code changes in a Go+ workspace.
Package watcher monitors code changes in a Go+ workspace.
x
jsonrpc2
Package jsonrpc2 is a minimal implementation of the JSON RPC 2 spec.
Package jsonrpc2 is a minimal implementation of the JSON RPC 2 spec.
jsonrpc2/internal/stack
Package stack provides support for parsing standard goroutine stack traces.
Package stack provides support for parsing standard goroutine stack traces.

Jump to

Keyboard shortcuts

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