INNER CODE UNIT · Go

main

c-bata/go-prompt · _example/http-prompt/main.go:166

func main() {
	var baseURL = "http://localhost:8000/"
	if len(os.Args) == 2 {
		baseURL = os.Args[1]
		if strings.HasSuffix(baseURL, "/") {
			baseURL += "/"
		}
	}
	u, err := url.Parse(baseURL)
	if err != nil {
		log.Fatal(err)
	}
	ctx = &RequestContext{
		url:    u,
		header: http.Header{},
		client: &http.Client{},
	}

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…