Giter VIP home page Giter VIP logo

gotools's Introduction

You have learnt GO, now what can you do with it ? Index

  1. greet
  2. hello
  3. helloname
  4. lineCount
  5. stringMatcher

Packages

All design decisions start and end with the package. The purpose of a package is to provide a solution to a specific problem domain. To be purposeful, packages must provide, not contain.
The more focused each package’s purpose is, the more clear it should be what the package provides.

A module in Go is a collection of (usually related) packages.

  • Good programmers, then, are always thinking in terms of writing importable packages, not mere dead‐end programs.
  • If we can figure out how to break down our unsolved problems into a bunch of mini‐ problems that have already been solved by existing packages, then we’re 90% done.
  • pkg.go.dev site lets you search and browse the whole universal library
  • to tackle some specific problem, a good place to check first is awesome‐go

Writing a test forces you to think clearly and precisely about the observable behaviour of the component under test, rather than the irrelevant details of its implementation.

  1. If we want to design a package, a great way to begin is by pretending it already exists, and writing code that uses it to solve our problem.

PaperWork

Designing packages instead of programs means we need to think about how other people might use our code.

  • Mandatory arguments are annoying : hello.PrintTo(os.Stdout) in packages chapter, here mentioning
    os.Stdout is like useless paperwork.
    • we can make os.stdout default if argument passed is nil but this makes it worse but

gotools's People

Contributors

devashishraj 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.