mirror of
https://github.com/foomo/foomo-docs.git
synced 2025-10-16 12:35:40 +00:00
feat: more work for dreadl0ck
This commit is contained in:
parent
9375533f1c
commit
99736c216c
9
foomo/blog/2022-01-19-map-race-debugging/index.mdx
Normal file
9
foomo/blog/2022-01-19-map-race-debugging/index.mdx
Normal file
@ -0,0 +1,9 @@
|
||||
---
|
||||
slug: debugging-go-map-races-in-k8s
|
||||
authors: [ philipp ]
|
||||
tags: [ go, debugging, backend ]
|
||||
---
|
||||
# debugging Go map races in k8s
|
||||
|
||||
|
||||
|
||||
@ -3,3 +3,8 @@ jan:
|
||||
title: foomo maintainer
|
||||
url: https://github.com/janhalfar
|
||||
image_url: https://github.com/janhalfar.png
|
||||
philipp:
|
||||
name: Philipp Mieden
|
||||
title: MSc
|
||||
url: https://github.com/dreadl0ck
|
||||
image_url: https://github.com/dreadl0ck.png
|
||||
|
||||
1
foomo/docs/backend/go-by-example/map-racing.md
Normal file
1
foomo/docs/backend/go-by-example/map-racing.md
Normal file
@ -0,0 +1 @@
|
||||
# map races
|
||||
2
foomo/docs/backend/go-by-example/panic-and-recover.md
Normal file
2
foomo/docs/backend/go-by-example/panic-and-recover.md
Normal file
@ -0,0 +1,2 @@
|
||||
# panic and recover
|
||||
|
||||
@ -21,8 +21,6 @@ import { IsItCool } from "./IsItCool";
|
||||
import Highlight, { defaultProps } from "prism-react-renderer";
|
||||
import Link from "@docusaurus/Link";
|
||||
|
||||
//src={"https://play.golang.org/p/" + props.id}
|
||||
|
||||
export const GoPlayground = (props: { id: string; proportion: number }) => {
|
||||
const [interactive, setInteractive] = useState(false);
|
||||
const [source, setSource] = useState("");
|
||||
@ -32,16 +30,12 @@ export const GoPlayground = (props: { id: string; proportion: number }) => {
|
||||
fetch("http://localhost:8080/?id=" + props.id, {
|
||||
mode: "cors",
|
||||
})
|
||||
.then((res) =>
|
||||
res
|
||||
.json()
|
||||
.then((data) => setSource(data.code))
|
||||
.catch((e) => setSource("parse json"))
|
||||
)
|
||||
.then((res) => res.text().then((newSource) => setSource(newSource)))
|
||||
.catch((e) => setSource("can not load source yet"));
|
||||
}
|
||||
}, [source]);
|
||||
const href = "https://goplay.tools/snippet/" + props.id;
|
||||
|
||||
return (
|
||||
<>
|
||||
<div style={{ paddingBottom: "1rem", width: "100%" }}>
|
||||
|
||||
@ -39,13 +39,15 @@ func serve(w http.ResponseWriter, r *http.Request) {
|
||||
http.Error(w, "no id get param given", http.StatusBadRequest)
|
||||
return
|
||||
}
|
||||
resp, err := http.Get("https://goplay.tools/api/snippet/" + id)
|
||||
|
||||
//resp, err := http.Get("https://goplay.tools/api/snippet/" + id)
|
||||
resp, err := http.Get("https://go.dev/_/share?id=" + id)
|
||||
if err != nil {
|
||||
http.Error(w, err.Error(), http.StatusInternalServerError)
|
||||
return
|
||||
}
|
||||
w.Header().Set("Access-Control-Allow-Origin", "*")
|
||||
w.Header().Set("Content-Type", "application/json")
|
||||
w.Header().Set("Content-Type", "text/plain")
|
||||
io.Copy(w, resp.Body)
|
||||
resp.Body.Close()
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user