1. Anatoly Galiulin
  2. gobs

Source

gobs /

Filename Size Date modified Message
examplelib
13 B
Modify project structure
2.3 KB
Documentation updated
7.2 KB
Documentation updated
2.1 KB
Template support in projects!!!
1.7 KB
Update editor settings
169 B
Template support in projects!!!
887 B
Modify project structure
117.6 KB
License generation support
1.9 KB
Add "clean" command
634 B
Add "clean" command
9.4 KB
Template support in projects!!!
2.8 KB
Add "install" section for resolve command
2.4 KB
Add -debug helper to build command
2.3 KB
Modify project structure
2.7 KB
Modify project structure

GOBS - build system and package manager for go language.

System description.

Many program languages have tools for managing dependencies. For example, java developers use maven or ivy. There's a tool npm for node.js. And so on.

Go-language have a tool go for it. However, it has some disadvantages:

  • There is no document, describing project dependencies.
  • go get tool uses compiler version to select appropriate dependency version, but not version required by project.
  • Uses system variable GOPATH as project root.

GOBS system attempts to solve this problems.

Quick start.

First of all, you need to install the gobs tool:

go get bitbucket.org/vegansk/gobs

If your system variable PATH contains $GOPATH/bin, then you can use the gobs command from your shell. Let's make a "Hello, world!" application. The first step is to create the project. Execute following command in desired directory:

gobs create -version 1.0 -license GPLv3 -desc "My first GOBS application" hw

Then change directory to the project sources:

cd hw/src/hw

Add a dependency to the project by creating deps object in goproject.json:

{
    "name": "hw",
    "version": "1.0",
    "description": "My first GOBS application",
    "license": "GPLv3",

    "deps": {
        "bitbucket.org/vegansk/gobs/examplelib": "*"
    }
}

Resolve dependencies with command:

gobs resolve

Create a file named hw.go with the following content:

package main

import "bitbucket.org/vegansk/gobs/examplelib"

func main() {
    examplelib.SayHello("World")
}

Build project using command:

gobs build

Cd to binary directory and execute project:

cd ../../bin && ./hw

You should see the message in the console:

Hello, world!

Project structure.

GOBS use standard directory structure for project, as described here.

There are two files, related to GOBS:

  • .goproject, located in the root of the workspace. Contains path to current project in src directory.
  • goproject.json, located in the root of the project's sources.