go main 源码

  • 2022-07-15
  • 浏览 (879)

golang main 代码

文件路径:/src/cmd/link/internal/ld/testdata/httptest/main/main.go

// A small test program that uses the net/http package. There is
// nothing special about net/http here, this is just a convenient way
// to pull in a lot of code.

package main

import (
	"net/http"
	"net/http/httptest"
)

type statusHandler int

func (h *statusHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
	w.WriteHeader(int(*h))
}

func main() {
	status := statusHandler(http.StatusNotFound)
	s := httptest.NewServer(&status)
	defer s.Close()
}

相关信息

go 源码目录

相关文章

go go_android_exec 源码

go argposition_test 源码

go badsym_test 源码

go errors_test 源码

go ptr_test 源码

go err1 源码

go err2 源码

go err4 源码

go issue11097a 源码

go issue11097b 源码

0  赞