cargo checkSometimes errors from macro expansion are too opaque to debug.
To see errors with the expanded macro set RUSTFLAGS like so:
RUSTFLAGS="-Z external-macro-backtrace" cargo +nightly [test|check]
We Gophers, love table-driven-tests, it makes our unittesting structured, and makes it easy to add different test cases with ease.
Let’s create our table driven test, for convenience, I chose to use t.Log as the test function.
Notice that we don't have any assertion in this test, it is not needed to for the demonstration.
func TestTLog(t *testing.T) {
t.Parallel()This is not an exhaustive list of all interfaces in Go's standard library.
I only list those I think are important.
Interfaces defined in frequently used packages (like io, fmt) are included.
Interfaces that have significant importance are also included.
All of the following information is based on go version go1.8.3 darwin/amd64.
| class RustNightly < Formula | |
| url "https://static.rust-lang.org/dist/rust-nightly-x86_64-apple-darwin.pkg", using: :nounzip | |
| homepage "http://www.rust-lang.org" | |
| sha1 "" | |
| version Date.today.to_s | |
| def install | |
| system "pkgutil --expand rust-nightly-x86_64-apple-darwin.pkg rn" |
| # Set variables in .bashrc file | |
| # don't forget to change your path correctly! | |
| export GOPATH=$HOME/golang | |
| export GOROOT=/usr/local/opt/go/libexec | |
| export PATH=$PATH:$GOPATH/bin | |
| export PATH=$PATH:$GOROOT/bin |
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"brew install git hgbrew install osxfuse (see Mac issues to troubleshoot common errors)