Giter Club home page Giter Club logo

go-swampup-service's Introduction

go-swampup-service

This is a simple go program to demonstrate using the modules feature of golang.

Prerequisites:

  • latest golang version with support for go modules (1.12.6)

  • Access to internet to clone the github project

  • Development machine

Initial Preparation

  1. Run git clone https://github.com/jfrogtraining/go-swampup-service and change to the go-swampup-service directory

  2. git checkout -b

  3. go build -v ./...

  4. You can manually run the service by typing ./go-swampup-service

  5. Test by running a GET on http://localhost:7888

  6. Observe the logs

  7. Interrupt the program by typing CTRL-C

Working with Modules

  1. Remove any go.mod and go.sum files and ensure GO111MODULE environment variable is set to "on" and set GOPROXY to https://gocenter.io

  2. Run go mod init go-swampup-service

  3. go mod tidy

  4. Edit main.go and uncomment the lines as instructed.

  5. Also comment out as instructed.

6 Now test again as before and observe the logs.

  1. git add main.go; git add go.mod; git add go.sum

  2. git commit -m "go modules test"

  3. git push If you see an error indicating there is no upstream set, just execute the command displayed. This is likely since we did not fork the github repo for simplicity e.g git push --set-upstream origin

  4. Send PR

11 After PR is merged, follow the jenkins pipelines

Conclusions

We imported logrus module from GoCenter and used it in our example. We saw the dependency on logrus module in go.mod

go-swampup-service's People

Contributors

shrajfr12 avatar stanlef 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.