Giter VIP home page Giter VIP logo

gotoolbox's Introduction

Go Tool Box

A set of golang utility functions

Compiling

Using Go Locally

Prerequisites

desiredApp

GOOS=linux go build -o ./bin/desiredApp ./desiredApp

Using Docker

Prerequisites

desiredApp

DOCKER_BUILDKIT=1 docker build -o bin --build-arg APP=desiredApp .

Specify Target Platform

DOCKER_BUILDKIT=1 docker build -o bin --build-arg APP=desiredApp --platform linux/386 .

These commands will compile the specified application and place the executable in the ./bin directory. The binary can then be distributed as needed

Tests

Run test Locally

Prerequisites

go test -v ./gtb

Expected Output

=== RUN   TestOpenBrowser
/usr/bin/open https://google.com
--- PASS: TestOpenBrowser (0.00s)
=== RUN   TestGetUserInfo
--- PASS: TestGetUserInfo (0.00s)
=== RUN   TestSplitMulti
--- PASS: TestSplitMulti (0.00s)
=== RUN   TestAToUint32
--- PASS: TestAToUint32 (0.00s)
=== RUN   TestGetFilesInDir
--- PASS: TestGetFilesInDir (0.00s)
PASS
ok      github.com/seemywingz/gotoolbox/gtb     0.013s

Run in Docker

Prerequisites

docker compose up

Expected Output

Starting gotoolbox_go-test_1 ... done
Attaching to gotoolbox_go-test_1
go-test_1  | === RUN   TestOpenBrowser
go-test_1  | xdg-open https://google.com
go-test_1  | --- PASS: TestOpenBrowser (0.00s)
go-test_1  | === RUN   TestGetUserInfo
go-test_1  | --- PASS: TestGetUserInfo (0.00s)
go-test_1  | === RUN   TestSplitMulti
go-test_1  | --- PASS: TestSplitMulti (0.00s)
go-test_1  | === RUN   TestAToUint32
go-test_1  | --- PASS: TestAToUint32 (0.00s)
go-test_1  | === RUN   TestGetFilesInDir
go-test_1  | --- PASS: TestGetFilesInDir (0.01s)
go-test_1  | PASS
go-test_1  | ok         gtb     0.013s
gotoolbox_go-test_1 exited with code 0

gotoolbox's People

Contributors

seemywingz avatar kevinjayne avatar seemywings avatar

Watchers

James Cloos avatar  avatar Kevin Boyette avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.