- Install Go 1.21
- Export a valid
GITHUB_TOKEN
- Create a directory for your project
- From your directory, run
go mod init github.com/yourUsername/yourProjectName
- Create a
main.go
file with the following contents in it:
package main
curl -v --user-agent "dartvoid/0.1 (https://github.com/dartvoid\) terminal/0.0" https://api.github.com/users/dartvoid | |
* About to connect() to api.github.com port 443 (#0) | |
* Trying 207.97.227.243... | |
* connected | |
* Connected to api.github.com (207.97.227.243) port 443 (#0) | |
* SSLv3, TLS handshake, Client hello (1): | |
* SSLv3, TLS handshake, Server hello (2): | |
* SSLv3, TLS handshake, CERT (11): | |
* SSLv3, TLS handshake, Server finished (14): | |
* SSLv3, TLS handshake, Client key exchange (16): |
{ | |
"openapi": "3.0.3", | |
"info": { | |
"version": "1.1.4", | |
"title": "GitHub v3 REST API", | |
"description": "GitHub's v3 REST API.", | |
"license": { | |
"name": "MIT", | |
"url": "https://spdx.org/licenses/MIT" | |
}, |
# my amazing colleague @fatih showed me this. saving it here so i don't forget it. | |
function switchgo() { | |
version=$1 | |
if [ -z $version ]; then | |
echo "Usage: switchgo [version]" | |
return | |
fi | |
if ! command -v "go$version" > /dev/null 2>&1; then | |
echo "version does not exist, downloading with commands: " | |
echo " go get golang.org/dl/go${version}" |