Lightning fast code searching made easy. Contribute to hound-search/hound development by creating an account on GitHub.
Lightning fast code searching made easy. Contribute to hound-search/hound development by creating an account on GitHub.
Personal Website of Patrick Bucher (paedubucher), mostly about IT-related topics (programming)
You want to become a full stack developer someday, so where do you start? Google's Go language is an excellent place.
Previously on Learning Go-Fuzz: "Learning Go-Fuzz 1: iprange" This time I am looking at a different package. This is a package called goexif at https://github.com/rwcarlsen/goexif. Being a file parser, it's a prime target for Go-Fuzz. Unfortunately it has not been updated for a while. Instead, we will be looking at a fork at https://github.com/xor-gate/goexif2. Code and fuzzing artifacts are at: https://github.com/parsiya/Go-Security/tree/master/go-fuzz/goexif2
how I do end-to-end testing of Go CLI applications
In this post, we'll see how Go tests are built more robustly with the quick package and how we can avoid incorrectly chosen parameters.
Have you always wanted to learn everything about testing with the Go standard library? I'll show you everything from the first test to parallelization.
Learn to write unit tests in Golang as we explore the basics then move onto isolating dependencies, fakes and code coverage with the Go's standard tools.
Minimalist text editor with vim-compatible key bindings. - aretext/aretext
Using Go 1.13’s new ReportMetric API to benchmark t-digest implementations with an example of how to use the new API to benchmark t-digest implementations
DEPRECATED: Use https://github.com/golangci/golangci-lint - alecthomas/gometalinter
Use NSQ to write Go benchmarks and evaluate performances.
The Go programming language comes with tools for writing and running tests: the standard librar [...]
Presentation of my personal setup and suggestion for preparing a nice Go environment and some other resources in which you can feel comfortable to start bashing out the code.
Benchmarks are often underestimated and don’t get the same attention as tests. However “performance is a feature” and when something is not tested it might as well be just broken. If the performance is not measured/tracked regressions are inevitable. Modern tooling makes it really easy to write benchmarks. Some languages have built-in support, for example, Rust comes with cargo bench (docs) and Go has go test -bench (docs). For C++ there is google/benchmark – not as streamlined as having it built into the language infrastructure, but still definitely worth the effort.
Godoc extracts and generates documentation for Go programs.
Godoc extracts and generates documentation for Go programs.
An integral part of the development licefycle is writing tests. Write tests early, write tests often as they say. Go makes it very easy to write tests. The following post will go through the basics of testing with Go. Let’s say we have a program that counts the number of vowels, consonants, digits and everything else within an input string. It may look something like this: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 package main import ( "flag" "fmt" ) // CountChars counts the number of characters in a string func CountChars(str string) (int, int, int, int) { vcount := 0 ccount := 0 dcount := 0 ocount := 0 for i := 0; i < len(str); i++ { switch str[i] { case 'a', 'e', 'i', 'o', 'u', 'A', 'E', 'I', 'O', 'U': vcount++ case 'b', 'c', 'd', 'f', 'g', 'h', 'j', 'k', 'l', 'm', 'n', 'p', 'q', 'r', 's', 't', 'v', 'w', 'x', 'y', 'z', 'B', 'C', 'D', 'F', 'G', 'H', 'J', 'K', 'L', 'M', 'N', 'P', 'Q', 'R', 'S', 'T', 'V', 'W', 'X', 'Y', 'Z': ccount++ case '1', '2', '3', '4', '5', '6', '7', '8', '9', '0': dcount++ default: ocount++ } } return vcount, ccount, dcount, ocount } func main() { inputStr := flag.String("inputStr", "", "The input string") flag.Parse() vowels, consonants, digits, other := CountChars(*inputStr) fmt.Println("Number of vowel chars: ", vowels) fmt.Println("Number of consonant chars: ", consonants) fmt.Println("Number of digit chars: ", digits) fmt.Println("Number of other chars: ", other) } Go provides a testing package to help with writing unit tests. Unit tests are contained in files typically ending in *_test.go. So to test the main function, you would have main_test.go in the same directory and so on. Files whose names begin with _ or . are ignored. There are three types of functions that are typically contained in a test file: TestXxx, ExampleXxx, BenchmarkXxx
A blog about programming, technology and open-source stuff.
Learn the Go programming language by building a test-driven command line todo application
Continous Integration tests are an important part of maintaining package stability. Since Travis has recently made it possible to run tests on OSX and with AppVeyor having Windows support, we now can create free CI tests for all the major desktop platforms. For my various packages, I find that I commonly copy+paste my CI tests,…
I’ve been following Go for a while due to the influence of one of my personal heroes: Ken Thompson (due to his hand in making Unix and C programming language).
This is an additional post in the “Go is not good” series. Go does have some nice features, hence the “The Good” part in this post, but overall I find it cumbersome and painful to use when we go beyond API or network servers (which is what it was designed ...
A short overview of the testing package # The testing package from Golang’s standard library provides support for automated testing of Go packages.
Practical guide to getting starting with Go language; from playing to deploying your first project.
Helping millions of developers easily build, test, manage, and scale applications of any size - faster than ever before.
Engineering Insights & Technical Deep Dives