github.com/Gnouc/gogi

Go client for gitignore.io


Keywords
git, gitignore, go, gogi, golang, golang-library, golang-tools
License
Other
Install
go get github.com/Gnouc/gogi

Documentation

gogi - Go client for gitignore.io

Build Status Go Report Card

Why gogi?

Make gitignore client more portable, without relying on the shell, curl, wget or any other http client.

Installation

go get -u github.com/Gnouc/gogi

Usage

import (
    "fmt"
    "io/ioutil"
    "log"

    "github.com/Gnouc/gogi"
)

func main() {
    gogiClient := gogi.NewHTTPClient(nil)
    resp, _ := gogiClient.List()
    body, err := ioutil.ReadAll(resp.Body)
    if body != nil {
        defer resp.Body.Close()
    }

    if err != nil {
        log.Fatal(err)
    }

    fmt.Println(string(body))
}

Install binary:

$ go get github.com/Gnouc/gogi/gogi
$ gogi
Usage of gogi:
  -create string
        Create .gitignore file for given types
  -list
        List all defined types

Environment variables

GOGI_API_URL to change your gitignore server, default to https://www.gitignore.io

Author

Cuong Manh Le cuong.manhle.vn@gmail.com

License

See LICENSE