godpkg

module
v0.2.2-alpha Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2018 License: MIT

README

godpkg

Go Environments use a opinionated project structure, which is why I scripted my Environment to manually switch between GOPATHs and symlink already existing versions of a dependency. godpkg is a cli-app which allows you to use the same scripts without having to manually copy them. Decide if you want to install a dependency in local scope (downloads / go get) right into your project folder or install it globally (global scope, downloads it into ~/.go-env, symlinks into your project). Get started with the godpkg init command.

Status

At this point this project is just a compilation of scripts I personally used into a small cli-app. There are more features planned but if you want to get a proper package manager people use in production environments today, please switch to more popular / established package managers:

Planned Features
  • Snapshoting Versioned Dependencies when installing in Global Scope
  • Windows Support
  • Release Command to copy dependencies into /vendor

Install

curl -sL https://github.com/jakoblorz/godpkg/releases/download/v0.2.1-alpha/godpkg-0.2.1-amd64 > /usr/local/bin/godpkg && chmod +x /usr/local/bin/godpkg

Usage

Initialize Project Folder
godpkg init <name>

You can then cd into the folder and execute all the other commands.

(Re-) Install Dependencies

To install specific dependencies, you can use the install command. go get ... is used under the hood. If you want to install the dependency directly (into the current project structure), choose local. Otherwise (global) the dependencies will be installed into ~/.go-env and symlinked into the project folder (linking bin, pkg and src). Similar to a "normal" Go Environment with fixed GOPATH, dependencies can be shared between different projects which reduces the footprint significantly.

godpkg install <local|global> github.com/user/...

When omitting all arguments (godpkg install), godpkg will read the ./packages file and install the listed dependencies (even with the original local/global scope).

Build your Project

If you call build, the file in src/<foldername>.go will be built.

godpkg build

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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