Skip to content

Instantly share code, notes, and snippets.

View zMrKrabz's full-sized avatar

Flexagon zMrKrabz

View GitHub Profile
@zMrKrabz
zMrKrabz / goprivatepackage.md
Created June 12, 2021 21:20
Using private packages in Go

If you were to go get a private repository with go, you would see something like this

$ go get github.com/zMrKrabz/flyent
go: downloading github.com/zMrKrabz/flyent v0.0.0-20210612205723-a495958a84ab
go get: github.com/zMrKrabz/flyent@v0.0.0-20210612205723-a495958a84ab: verifying module: github.com/zMrKrabz/flyent@v0.0.0-20210612205723-a495958a84ab: reading https://sum.golang.org/lookup/github.com/z!mr!krabz/flyent@v0.0.0-20210612205723-a495958a84ab: 410 Gone
	server response:
	not found: github.com/zMrKrabz/flyent@v0.0.0-20210612205723-a495958a84ab: invalid version: git fetch -f origin refs/heads/*:refs/heads/* refs/tags/*:refs/tags/* in /tmp/gopath/pkg/mod/cache/vcs/d455a9bff29b25fc089b95289e07ca4a6886822823a65d8b41247eae8baf04a7: exit status 128:
		fatal: could not read Username for 'https://github.com': terminal prompts disabled
@zMrKrabz
zMrKrabz / testRequest.ts
Created January 25, 2021 17:35
How to mock requests and test functions
import nock from "nock";
import "mocha";
import { expect } from "chai";
import got, { ExtendOptions } from "got";
describe("Request Test", () => {
// Instead of having our requests visit the acutal API, we mock responses
nock("https://api.kanye.rest")
.get("/")
.reply(200, { quote: "For me giving up is way harder than trying." } );
### Keybase proof
I hereby claim:
* I am zmrkrabz on github.
* I am jadetycoon (https://keybase.io/jadetycoon) on keybase.
* I have a public key ASBAyLj43W2ZmUvXH6EQLUnazDc_kWX7EhmyV9JD2FvnAgo
To claim this, I am signing this object: