Giter Club home page Giter Club logo

golazy's Introduction


🌴golazy🍸

Golang module exporting general purpose functions I get tired of rewriting every time

workflows Go Reference


go get github.com/edoardottt/golazy

Name Description
ScanInputStdin() []string It returns the array of elements taken as input on stdin.
RemoveDuplicateStrings(strSlice []string) []string It removes duplicates from a slice of strings taken as input and returns the result
RemoveDuplicateInts(intSlice []int) []int It removes duplicates from a slice of integers taken as input and returns the result
RemoveDuplicateFloats(floatSlice []float64) []float64 It removes duplicates from a slice of floats taken as input and returns the result
AppendOutputToTxt(output string, filename string) It tries to append the output string in the file "filename" taken as input.
AppendOutputToTxtAndExit(output string, filename string) It appends the output string in the file "filename" taken as input, but if it encounters an error it logs it and exits.
GetHost(input string) (string, error) It takes as input a string and tries to parse it as url, if it's a well formatted url it returns the host (the domain if you prefer)
GetProtocol(input string) (string, error) It takes as input a string and tries to parse it as url, if it's a well formatted url it returns the protocol
HasProtocol(input string) bool It takes as input a string and checks if it has a protocol ( like in a URI/URL)
RemoveProtocol(input string) string It removes the protocol from the input string (something://...). If it's not present it returns the input
RemovePort(input string) string It removes port from the input string. If it's not present it returns the input
SameDomain(url1 string, url2 string) bool It checks if two urls have the same domain
GetPath(input string) (string, error) It returns the path of the input string (if correctly URL-formatted)
ReadFileLineByLine(inputFile string) []string It reads from a file taken as input and returns a slice of strings (duplicates allowed).
GenerateRandomUserAgent() string It generates a Random User Agent.

License πŸ“

This repository is under GNU General Public License v3.0.
edoardoottavianelli.it to contact me.

golazy's People

Contributors

edoardottt avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

golazy's Issues

Add Goreleaser

In resource-constrained environments we sometimes cannot afford to install full-blown Go + build packages with it: good practice is to have pre-packaged binary releases for each platform.

You can include this in a GitHub action workflow, by leveraging something like the https://github.com/marketplace/actions/go-release-binaries action which automates the process.

For reference:

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.