Skip to content

Instantly share code, notes, and snippets.

View jonathan-fielding's full-sized avatar

Jonathan Fielding jonathan-fielding

View GitHub Profile
package main
import (
"fmt"
)
func main() {
var nth int
// Print our request to the user
package main
import (
"fmt"
"sort"
"strings"
)
func main() {
var string1 string
---
kind: Service
apiVersion: v1
metadata:
name: reverse-proxy
spec:
type: LoadBalancer
selector:
app: reverse-proxy
ports:
import (
"encoding/json"
"fmt"
"net/http"
"time"
)
func response(w http.ResponseWriter, req *http.Request) {
resp, err := http.Get("https://cat-fact.herokuapp.com/facts/random?amount=1")
if err != nil {
panic(err)
}
defer resp.Body.Close()
var catfacts CatFacts
type AutoGenerated struct {
Status struct {
Verified bool `json:"verified"`
SentCount int `json:"sentCount"`
} `json:"status"`
Type string `json:"type"`
Deleted bool `json:"deleted"`
ID string `json:"_id"`
UpdatedAt time.Time `json:"updatedAt"`
CreatedAt time.Time `json:"createdAt"`
package main
import (
"fmt"
"net/http"
)
func response(w http.ResponseWriter, req *http.Request) {
fmt.Fprintf(w, "Cat fact")
}
package main
import "fmt"
func main() {
}
package main
import (
"encoding/json"
"fmt"
"net/http"
"time"
)
type CatFacts struct {
package main
import (
"net/http"
)
func main() {
http.ListenAndServe(":8000", nil)
}