ProductPromotion
Logo

Go.Lang

made by https://0x3d.site

GitHub - lunny/gop: Moved to https://gitea.com/lunny/gop
Moved to https://gitea.com/lunny/gop. Contribute to lunny/gop development by creating an account on GitHub.
Visit Site

GitHub - lunny/gop: Moved to https://gitea.com/lunny/gop

GitHub - lunny/gop: Moved to https://gitea.com/lunny/gop

GOP

简体中文

CircleCI codecov

GOP is a project manangement tool for building your golang applications out of global GOPATH. In fact gop will keep both global GOPATH and every project GOPATH. But that means your project will not go-getable. Of course, GOP itself is go-getable. GOP copy all denpendencies from global GOPATH to your project's src/vendor directory and all application's sources are also in src directory.

A normal process using gop is below:

git clone [email protected]:bac/aaa.git
cd aaa
gop ensure -g
gop build
gop test

Features

  • GOPATH compitable
  • Multiple build targets support
  • Put your projects out of global GOPATH

Installation

Please ensure you have installed the go command, GOP will invoke it on building or testing

go get github.com/lunny/gop

Directory structure

Every project should have a GOPATH directory structure and put a gop.yml int the root directory. This is an example project's directory tree.

<project root>
├── gop.yml
├── bin
├── doc
└── src
    ├── main
    │   └── main.go
    ├── models
    │   └── models.go
    ├── routes
    │   └── routes.go
    └── vendor
        └── github.com
            ├── go-xorm
            │   ├── builder
            │   ├── core
            │   └── xorm
            └── lunny
                ├── log
                └── tango

Gop.yml

Gop will recognize a gop project which has gop.yml. The file is also a project configuration file. Below is an example. If you didn't define any target, the default target is src/main and the target name is the project name.

targets:
- name: myproject1
  dir: main
  assets:
  - templates
  - public
  - config.ini
  - key.pem
  - cert.pem
- name: myproject2
  dir: web
  assets:
  - templates
  - public
  - config.ini
  monitors:
  - config.ini

Command

init

Create the default directory structure tree.

mkdir newproject
cd newproject
gop init

and you can also create config file for vscode

gop init -e=vscode

ensure

Automatically copy dependencies from $GOPATH to local project directory. -g will let you automatically call go get <package> when the package is missing on GOPATH. -u will always go get <package> on all the dependencies and copy them to vendor.

gop ensure [-g|-u] [target_name]

status

List all dependencies of this project and show the status.

gop status [target_name]

add

Add one or more packages to this project.

gop add <package1> <package2>

update

Update one or more packages to this project. All missing dependent packages will also be added. -f will update exists dependent packages.

gop update [-f] <package1> <package2>

rm

Remove one or more packages from this project.

gop rm <package1> <package2>

build

Run go build on the src directory. If you want to execute ensure before build, you can use -e flag.

gop build [-e] [target_name]

run

Run go run on the src directory. -w will monitor the go source code changes and automatically build and run again. -e will automatically execute ensure before every time build.

gop run [-w] [target_name]

test

Run go test on the src directory. If you want to execute ensure before build, you can use -e flag.

gop test [-e] [target_name]

release

Run go release on the src directory.

gop release [target_name]

TODO

  • Versions support, specify a dependency package verison
  • Support run gop in GOPATH

Articles
to learn more about the golang concepts.

Resources
which are currently available to browse on.

mail [email protected] to add your project or resources here 🔥.

FAQ's
to know more about the topic.

mail [email protected] to add your project or resources here 🔥.

Queries
or most google FAQ's about GoLang.

mail [email protected] to add more queries here 🔍.

More Sites
to check out once you're finished browsing here.

0x3d
https://www.0x3d.site/
0x3d is designed for aggregating information.
NodeJS
https://nodejs.0x3d.site/
NodeJS Online Directory
Cross Platform
https://cross-platform.0x3d.site/
Cross Platform Online Directory
Open Source
https://open-source.0x3d.site/
Open Source Online Directory
Analytics
https://analytics.0x3d.site/
Analytics Online Directory
JavaScript
https://javascript.0x3d.site/
JavaScript Online Directory
GoLang
https://golang.0x3d.site/
GoLang Online Directory
Python
https://python.0x3d.site/
Python Online Directory
Swift
https://swift.0x3d.site/
Swift Online Directory
Rust
https://rust.0x3d.site/
Rust Online Directory
Scala
https://scala.0x3d.site/
Scala Online Directory
Ruby
https://ruby.0x3d.site/
Ruby Online Directory
Clojure
https://clojure.0x3d.site/
Clojure Online Directory
Elixir
https://elixir.0x3d.site/
Elixir Online Directory
Elm
https://elm.0x3d.site/
Elm Online Directory
Lua
https://lua.0x3d.site/
Lua Online Directory
C Programming
https://c-programming.0x3d.site/
C Programming Online Directory
C++ Programming
https://cpp-programming.0x3d.site/
C++ Programming Online Directory
R Programming
https://r-programming.0x3d.site/
R Programming Online Directory
Perl
https://perl.0x3d.site/
Perl Online Directory
Java
https://java.0x3d.site/
Java Online Directory
Kotlin
https://kotlin.0x3d.site/
Kotlin Online Directory
PHP
https://php.0x3d.site/
PHP Online Directory
React JS
https://react.0x3d.site/
React JS Online Directory
Angular
https://angular.0x3d.site/
Angular JS Online Directory