GithubHelp home page GithubHelp logo

calc's Introduction

calc

used to demonstrate managing go projects (demo 4 / 5) module 3 - see PluralSight

The PluralSight course, Managing Go Projects, changes from the first section on package to the benefits and capabilities of the second section - modules. For any content references or use other than use of this repository, must go to PluralSight and speak with the author of "Managing Go Projects" released in 2023.

In "demo1" to "demo5" in Modules, it used a calc package and showed how it could be deployed as package within same folder as demo module, and later as a package under $GOROOT/src/calc.

Along the way, you got a feel of the ways that a module could call external components and of course that means you could imagine a Sprint by a Scrum team working separately to deliver different value of the overall app that will come together. Along with the benefits, the author/presenter did a good job of covering the thought processes and any shortcomings that would occur if you had to now have the package or module run on a different machine.

In "demo6", one solution is to use an external repository -- but instead of staying with the inventory example with simple components -- demo6 reach out to what I thought was an over the top Github respository with so many dependencies. In my opinion, it was just too much -- I don't know the author of the respository "faker" and was not ready to lose focus by doing my normal security due diligence rather than just putting an example together with 'calc' on github.

That's what this is -- just an external placeholder for calc.go from the course to be called, so that all the new lessons on changes to go.mod and the inclusion of go.sum could be understood.

My session for demo6:

cd $GOPATH\src\psmp_2
mkdir psmp206; cd psmp506
touch main.go
go mod init psmp_2.psmp506
vi main.go
go run .
go get github.com/AchieveGoals/calc
cat go.mod
go run .
cat go.sum

In main.go, the only change was the import (...) section From:

import (
  "fmt" 
  
  "calc"
)

To:

import (
  "fmt"
  
  "github.com\AchieveGoals\calc"
)

Note: the calc.Discount() line didn't change: totalDiscount := calc.Discount(itemPrice, itemDiscount)

I mean, how simple has Go made bringing in an external library.

So back to see where demo 7 goes.

calc's People

Contributors

achievegoals avatar

Watchers

 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.