mirror of https://github.com/gofiber/fiber.git
✨feature: print all routes message when server starts (#1677)
* ✨feature: print all routes message when server starts * ✨feature: print all routes message when server starts * ✨feature: print all routes message when server starts * 🐛fix: errors unhandled * 🐛fix: ignore child process and add some "-" to the table head * 🐛fix: add printRoutesMessage for listener and listenTLSpull/1681/head
parent
244d5a5450
commit
f98a9ba405
74
app.go
74
app.go
|
@ -20,10 +20,12 @@ import (
|
||||||
"os"
|
"os"
|
||||||
"reflect"
|
"reflect"
|
||||||
"runtime"
|
"runtime"
|
||||||
|
"sort"
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
"sync"
|
"sync"
|
||||||
"sync/atomic"
|
"sync/atomic"
|
||||||
|
"text/tabwriter"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/gofiber/fiber/v2/internal/colorable"
|
"github.com/gofiber/fiber/v2/internal/colorable"
|
||||||
|
@ -350,6 +352,10 @@ type Config struct {
|
||||||
// Default: []string
|
// Default: []string
|
||||||
TrustedProxies []string `json:"trusted_proxies"`
|
TrustedProxies []string `json:"trusted_proxies"`
|
||||||
trustedProxiesMap map[string]struct{}
|
trustedProxiesMap map[string]struct{}
|
||||||
|
|
||||||
|
//If set to true, will print all routes with their method, path and handler.
|
||||||
|
// Default: false
|
||||||
|
EnablePrintRoutes bool `json:"print_routes"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// Static defines configuration options when defining static assets.
|
// Static defines configuration options when defining static assets.
|
||||||
|
@ -389,6 +395,14 @@ type Static struct {
|
||||||
Next func(c *Ctx) bool
|
Next func(c *Ctx) bool
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// RouteMessage is some message need to be print when server starts
|
||||||
|
type RouteMessage struct {
|
||||||
|
name string
|
||||||
|
method string
|
||||||
|
path string
|
||||||
|
handlers string
|
||||||
|
}
|
||||||
|
|
||||||
// Default Config values
|
// Default Config values
|
||||||
const (
|
const (
|
||||||
DefaultBodyLimit = 4 * 1024 * 1024
|
DefaultBodyLimit = 4 * 1024 * 1024
|
||||||
|
@ -713,6 +727,10 @@ func (app *App) Listener(ln net.Listener) error {
|
||||||
if !app.config.DisableStartupMessage {
|
if !app.config.DisableStartupMessage {
|
||||||
app.startupMessage(ln.Addr().String(), getTlsConfig(ln) != nil, "")
|
app.startupMessage(ln.Addr().String(), getTlsConfig(ln) != nil, "")
|
||||||
}
|
}
|
||||||
|
// Print routes
|
||||||
|
if app.config.EnablePrintRoutes {
|
||||||
|
app.printRoutesMessage()
|
||||||
|
}
|
||||||
// Start listening
|
// Start listening
|
||||||
return app.server.Serve(ln)
|
return app.server.Serve(ln)
|
||||||
}
|
}
|
||||||
|
@ -737,6 +755,10 @@ func (app *App) Listen(addr string) error {
|
||||||
if !app.config.DisableStartupMessage {
|
if !app.config.DisableStartupMessage {
|
||||||
app.startupMessage(ln.Addr().String(), false, "")
|
app.startupMessage(ln.Addr().String(), false, "")
|
||||||
}
|
}
|
||||||
|
// Print routes
|
||||||
|
if app.config.EnablePrintRoutes {
|
||||||
|
app.printRoutesMessage()
|
||||||
|
}
|
||||||
// Start listening
|
// Start listening
|
||||||
return app.server.Serve(ln)
|
return app.server.Serve(ln)
|
||||||
}
|
}
|
||||||
|
@ -777,6 +799,10 @@ func (app *App) ListenTLS(addr, certFile, keyFile string) error {
|
||||||
if !app.config.DisableStartupMessage {
|
if !app.config.DisableStartupMessage {
|
||||||
app.startupMessage(ln.Addr().String(), true, "")
|
app.startupMessage(ln.Addr().String(), true, "")
|
||||||
}
|
}
|
||||||
|
// Print routes
|
||||||
|
if app.config.EnablePrintRoutes {
|
||||||
|
app.printRoutesMessage()
|
||||||
|
}
|
||||||
// Start listening
|
// Start listening
|
||||||
return app.server.ServeTLS(ln, certFile, keyFile)
|
return app.server.ServeTLS(ln, certFile, keyFile)
|
||||||
}
|
}
|
||||||
|
@ -1198,3 +1224,51 @@ func (app *App) startupMessage(addr string, tls bool, pids string) {
|
||||||
|
|
||||||
_, _ = fmt.Fprintln(out, output)
|
_, _ = fmt.Fprintln(out, output)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// printRoutesMessage print all routes with method, path, name and handlers
|
||||||
|
// in a format of table, like this:
|
||||||
|
// method | path | name | handlers
|
||||||
|
// GET | / | routeName | github.com/gofiber/fiber/v2.emptyHandler
|
||||||
|
// HEAD | / | | github.com/gofiber/fiber/v2.emptyHandler
|
||||||
|
func (app *App) printRoutesMessage() {
|
||||||
|
// ignore child processes
|
||||||
|
if IsChild() {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
const (
|
||||||
|
// cBlack = "\u001b[90m"
|
||||||
|
// cRed = "\u001b[91m"
|
||||||
|
cCyan = "\u001b[96m"
|
||||||
|
cGreen = "\u001b[92m"
|
||||||
|
cYellow = "\u001b[93m"
|
||||||
|
cBlue = "\u001b[94m"
|
||||||
|
// cMagenta = "\u001b[95m"
|
||||||
|
cWhite = "\u001b[97m"
|
||||||
|
// cReset = "\u001b[0m"
|
||||||
|
)
|
||||||
|
var routes []RouteMessage
|
||||||
|
for _, routeStack := range app.stack {
|
||||||
|
for _, route := range routeStack {
|
||||||
|
var newRoute = RouteMessage{}
|
||||||
|
newRoute.name = route.Name
|
||||||
|
newRoute.method = route.Method
|
||||||
|
newRoute.path = route.Path
|
||||||
|
for _, handler := range route.Handlers {
|
||||||
|
newRoute.handlers += runtime.FuncForPC(reflect.ValueOf(handler).Pointer()).Name() + " "
|
||||||
|
}
|
||||||
|
routes = append(routes, newRoute)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
w := tabwriter.NewWriter(os.Stdout, 1, 1, 1, ' ', 0)
|
||||||
|
// Sort routes by path
|
||||||
|
sort.Slice(routes, func(i, j int) bool {
|
||||||
|
return routes[i].path < routes[j].path
|
||||||
|
})
|
||||||
|
_, _ = fmt.Fprintf(w, "%smethod\t%s| %spath\t%s| %sname\t%s| %shandlers\n", cBlue, cWhite, cGreen, cWhite, cCyan, cWhite, cYellow)
|
||||||
|
_, _ = fmt.Fprintf(w, "%s------\t%s| %s----\t%s| %s----\t%s| %s--------\n", cBlue, cWhite, cGreen, cWhite, cCyan, cWhite, cYellow)
|
||||||
|
for _, route := range routes {
|
||||||
|
_, _ = fmt.Fprintf(w, "%s%s\t%s| %s%s\t%s| %s%s\t%s| %s%s\n", cBlue, route.method, cWhite, cGreen, route.path, cWhite, cCyan, route.name, cWhite, cYellow, route.handlers)
|
||||||
|
}
|
||||||
|
_ = w.Flush()
|
||||||
|
}
|
||||||
|
|
37
app_test.go
37
app_test.go
|
@ -1576,3 +1576,40 @@ func Test_App_UseMountedErrorHandlerForBestPrefixMatch(t *testing.T) {
|
||||||
utils.AssertEqual(t, nil, err, "iotuil.ReadAll()")
|
utils.AssertEqual(t, nil, err, "iotuil.ReadAll()")
|
||||||
utils.AssertEqual(t, "hi, i'm a custom sub sub fiber error", string(b), "Third fiber Response body")
|
utils.AssertEqual(t, "hi, i'm a custom sub sub fiber error", string(b), "Third fiber Response body")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func emptyHandler(c *Ctx) error {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func Test_App_print_Route(t *testing.T) {
|
||||||
|
app := New(Config{EnablePrintRoutes: true})
|
||||||
|
app.Get("/", emptyHandler).Name("routeName")
|
||||||
|
printRoutesMessage := captureOutput(func() {
|
||||||
|
app.printRoutesMessage()
|
||||||
|
})
|
||||||
|
fmt.Println(printRoutesMessage)
|
||||||
|
utils.AssertEqual(t, true, strings.Contains(printRoutesMessage, "GET"))
|
||||||
|
utils.AssertEqual(t, true, strings.Contains(printRoutesMessage, "/"))
|
||||||
|
utils.AssertEqual(t, true, strings.Contains(printRoutesMessage, "emptyHandler"))
|
||||||
|
utils.AssertEqual(t, true, strings.Contains(printRoutesMessage, "routeName"))
|
||||||
|
}
|
||||||
|
|
||||||
|
func Test_App_print_Route_with_group(t *testing.T) {
|
||||||
|
app := New(Config{EnablePrintRoutes: true})
|
||||||
|
app.Get("/", emptyHandler)
|
||||||
|
v1 := app.Group("v1")
|
||||||
|
v1.Get("/test", emptyHandler).Name("v1")
|
||||||
|
v1.Post("/test/fiber", emptyHandler)
|
||||||
|
v1.Put("/test/fiber/*", emptyHandler)
|
||||||
|
printRoutesMessage := captureOutput(func() {
|
||||||
|
app.printRoutesMessage()
|
||||||
|
})
|
||||||
|
fmt.Println(printRoutesMessage)
|
||||||
|
utils.AssertEqual(t, true, strings.Contains(printRoutesMessage, "GET"))
|
||||||
|
utils.AssertEqual(t, true, strings.Contains(printRoutesMessage, "/"))
|
||||||
|
utils.AssertEqual(t, true, strings.Contains(printRoutesMessage, "emptyHandler"))
|
||||||
|
utils.AssertEqual(t, true, strings.Contains(printRoutesMessage, "/v1/test"))
|
||||||
|
utils.AssertEqual(t, true, strings.Contains(printRoutesMessage, "POST"))
|
||||||
|
utils.AssertEqual(t, true, strings.Contains(printRoutesMessage, "/v1/test/fiber"))
|
||||||
|
utils.AssertEqual(t, true, strings.Contains(printRoutesMessage, "PUT"))
|
||||||
|
utils.AssertEqual(t, true, strings.Contains(printRoutesMessage, "/v1/test/fiber/*"))
|
||||||
|
}
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
//go:build appengine
|
||||||
// +build appengine
|
// +build appengine
|
||||||
|
|
||||||
package colorable
|
package colorable
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
// +build !windows
|
//go:build !windows && !appengine
|
||||||
// +build !appengine
|
// +build !windows,!appengine
|
||||||
|
|
||||||
package colorable
|
package colorable
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
// +build windows
|
//go:build windows && !appengine
|
||||||
// +build !appengine
|
// +build windows,!appengine
|
||||||
|
|
||||||
package colorable
|
package colorable
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
//go:build !appengine
|
||||||
// +build !appengine
|
// +build !appengine
|
||||||
|
|
||||||
package fasttemplate
|
package fasttemplate
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
//go:build appengine
|
||||||
// +build appengine
|
// +build appengine
|
||||||
|
|
||||||
package fasttemplate
|
package fasttemplate
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
//go:build appengine
|
||||||
// +build appengine
|
// +build appengine
|
||||||
|
|
||||||
package fwd
|
package fwd
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
//go:build !appengine
|
||||||
// +build !appengine
|
// +build !appengine
|
||||||
|
|
||||||
package fwd
|
package fwd
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
//go:build windows
|
||||||
// +build windows
|
// +build windows
|
||||||
|
|
||||||
package ole
|
package ole
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
//go:build !windows
|
||||||
// +build !windows
|
// +build !windows
|
||||||
|
|
||||||
package ole
|
package ole
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
//go:build !windows
|
||||||
// +build !windows
|
// +build !windows
|
||||||
|
|
||||||
package ole
|
package ole
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
//go:build windows
|
||||||
// +build windows
|
// +build windows
|
||||||
|
|
||||||
package ole
|
package ole
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
//go:build !windows
|
||||||
// +build !windows
|
// +build !windows
|
||||||
|
|
||||||
package ole
|
package ole
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
//go:build windows
|
||||||
// +build windows
|
// +build windows
|
||||||
|
|
||||||
package ole
|
package ole
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
//go:build !windows
|
||||||
// +build !windows
|
// +build !windows
|
||||||
|
|
||||||
package ole
|
package ole
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
//go:build windows
|
||||||
// +build windows
|
// +build windows
|
||||||
|
|
||||||
package ole
|
package ole
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
//go:build !windows
|
||||||
// +build !windows
|
// +build !windows
|
||||||
|
|
||||||
package ole
|
package ole
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
//go:build windows
|
||||||
// +build windows
|
// +build windows
|
||||||
|
|
||||||
package ole
|
package ole
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
//go:build !windows
|
||||||
// +build !windows
|
// +build !windows
|
||||||
|
|
||||||
package ole
|
package ole
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
//go:build windows
|
||||||
// +build windows
|
// +build windows
|
||||||
|
|
||||||
package ole
|
package ole
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
//go:build !windows
|
||||||
// +build !windows
|
// +build !windows
|
||||||
|
|
||||||
package ole
|
package ole
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
//go:build windows
|
||||||
// +build windows
|
// +build windows
|
||||||
|
|
||||||
package ole
|
package ole
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
//go:build !windows
|
||||||
// +build !windows
|
// +build !windows
|
||||||
|
|
||||||
package ole
|
package ole
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
//go:build windows
|
||||||
// +build windows
|
// +build windows
|
||||||
|
|
||||||
package ole
|
package ole
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
//go:build !windows
|
||||||
// +build !windows
|
// +build !windows
|
||||||
|
|
||||||
package ole
|
package ole
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
//go:build windows
|
||||||
// +build windows
|
// +build windows
|
||||||
|
|
||||||
package ole
|
package ole
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
//go:build !windows
|
||||||
// +build !windows
|
// +build !windows
|
||||||
|
|
||||||
package ole
|
package ole
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
//go:build windows
|
||||||
// +build windows
|
// +build windows
|
||||||
|
|
||||||
package ole
|
package ole
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
//go:build windows
|
||||||
// +build windows
|
// +build windows
|
||||||
|
|
||||||
package oleutil
|
package oleutil
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
//go:build !windows
|
||||||
// +build !windows
|
// +build !windows
|
||||||
|
|
||||||
package oleutil
|
package oleutil
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
//go:build windows
|
||||||
// +build windows
|
// +build windows
|
||||||
|
|
||||||
package oleutil
|
package oleutil
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
// This file is here so go get succeeds as without it errors with:
|
// This file is here so go get succeeds as without it errors with:
|
||||||
// no buildable Go source files in ...
|
// no buildable Go source files in ...
|
||||||
//
|
//
|
||||||
|
//go:build !windows
|
||||||
// +build !windows
|
// +build !windows
|
||||||
|
|
||||||
package oleutil
|
package oleutil
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
//go:build !windows
|
||||||
// +build !windows
|
// +build !windows
|
||||||
|
|
||||||
package ole
|
package ole
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
//go:build windows
|
||||||
// +build windows
|
// +build windows
|
||||||
|
|
||||||
package ole
|
package ole
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
//go:build windows
|
||||||
// +build windows
|
// +build windows
|
||||||
|
|
||||||
package ole
|
package ole
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
//go:build windows
|
||||||
// +build windows
|
// +build windows
|
||||||
|
|
||||||
package ole
|
package ole
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
//go:build 386
|
||||||
// +build 386
|
// +build 386
|
||||||
|
|
||||||
package ole
|
package ole
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
//go:build amd64
|
||||||
// +build amd64
|
// +build amd64
|
||||||
|
|
||||||
package ole
|
package ole
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
//go:build windows && 386
|
||||||
// +build windows,386
|
// +build windows,386
|
||||||
|
|
||||||
package ole
|
package ole
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
//go:build windows && amd64
|
||||||
// +build windows,amd64
|
// +build windows,amd64
|
||||||
|
|
||||||
package ole
|
package ole
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
//go:build ppc64le
|
||||||
// +build ppc64le
|
// +build ppc64le
|
||||||
|
|
||||||
package ole
|
package ole
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
//go:build s390x
|
||||||
// +build s390x
|
// +build s390x
|
||||||
|
|
||||||
package ole
|
package ole
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
//go:build windows
|
||||||
// +build windows
|
// +build windows
|
||||||
|
|
||||||
package ole
|
package ole
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
//go:build !windows
|
||||||
// +build !windows
|
// +build !windows
|
||||||
|
|
||||||
package ole
|
package ole
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
//go:build darwin
|
||||||
// +build darwin
|
// +build darwin
|
||||||
|
|
||||||
package common
|
package common
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
//go:build freebsd || openbsd
|
||||||
// +build freebsd openbsd
|
// +build freebsd openbsd
|
||||||
|
|
||||||
package common
|
package common
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
//go:build linux
|
||||||
// +build linux
|
// +build linux
|
||||||
|
|
||||||
package common
|
package common
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
//go:build openbsd
|
||||||
// +build openbsd
|
// +build openbsd
|
||||||
|
|
||||||
package common
|
package common
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
//go:build linux || freebsd || darwin || openbsd
|
||||||
// +build linux freebsd darwin openbsd
|
// +build linux freebsd darwin openbsd
|
||||||
|
|
||||||
package common
|
package common
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
//go:build darwin
|
||||||
// +build darwin
|
// +build darwin
|
||||||
|
|
||||||
package cpu
|
package cpu
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
// +build darwin
|
//go:build darwin && cgo
|
||||||
// +build cgo
|
// +build darwin,cgo
|
||||||
|
|
||||||
package cpu
|
package cpu
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
// +build darwin
|
//go:build darwin && !cgo
|
||||||
// +build !cgo
|
// +build darwin,!cgo
|
||||||
|
|
||||||
package cpu
|
package cpu
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
//go:build !darwin && !linux && !freebsd && !openbsd && !solaris && !windows && !dragonfly
|
||||||
// +build !darwin,!linux,!freebsd,!openbsd,!solaris,!windows,!dragonfly
|
// +build !darwin,!linux,!freebsd,!openbsd,!solaris,!windows,!dragonfly
|
||||||
|
|
||||||
package cpu
|
package cpu
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
//go:build linux
|
||||||
// +build linux
|
// +build linux
|
||||||
|
|
||||||
package cpu
|
package cpu
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
//go:build openbsd
|
||||||
// +build openbsd
|
// +build openbsd
|
||||||
|
|
||||||
package cpu
|
package cpu
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
//go:build windows
|
||||||
// +build windows
|
// +build windows
|
||||||
|
|
||||||
package cpu
|
package cpu
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
//go:build freebsd || openbsd
|
||||||
// +build freebsd openbsd
|
// +build freebsd openbsd
|
||||||
|
|
||||||
package load
|
package load
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
//go:build freebsd
|
||||||
// +build freebsd
|
// +build freebsd
|
||||||
|
|
||||||
package load
|
package load
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
//go:build openbsd
|
||||||
// +build openbsd
|
// +build openbsd
|
||||||
|
|
||||||
package load
|
package load
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
//go:build darwin
|
||||||
// +build darwin
|
// +build darwin
|
||||||
|
|
||||||
package mem
|
package mem
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
// +build darwin
|
//go:build darwin && cgo
|
||||||
// +build cgo
|
// +build darwin,cgo
|
||||||
|
|
||||||
package mem
|
package mem
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
// +build darwin
|
//go:build darwin && !cgo
|
||||||
// +build !cgo
|
// +build darwin,!cgo
|
||||||
|
|
||||||
package mem
|
package mem
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
//go:build !darwin && !linux && !freebsd && !openbsd && !solaris && !windows
|
||||||
// +build !darwin,!linux,!freebsd,!openbsd,!solaris,!windows
|
// +build !darwin,!linux,!freebsd,!openbsd,!solaris,!windows
|
||||||
|
|
||||||
package mem
|
package mem
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
//go:build freebsd
|
||||||
// +build freebsd
|
// +build freebsd
|
||||||
|
|
||||||
package mem
|
package mem
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
//go:build linux
|
||||||
// +build linux
|
// +build linux
|
||||||
|
|
||||||
package mem
|
package mem
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
//go:build openbsd
|
||||||
// +build openbsd
|
// +build openbsd
|
||||||
|
|
||||||
package mem
|
package mem
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
// +build openbsd
|
//go:build openbsd && 386
|
||||||
// +build 386
|
// +build openbsd,386
|
||||||
|
|
||||||
// Code generated by cmd/cgo -godefs; DO NOT EDIT.
|
// Code generated by cmd/cgo -godefs; DO NOT EDIT.
|
||||||
// cgo -godefs mem/types_openbsd.go
|
// cgo -godefs mem/types_openbsd.go
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
//go:build windows
|
||||||
// +build windows
|
// +build windows
|
||||||
|
|
||||||
package mem
|
package mem
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
//go:build ignore
|
||||||
// +build ignore
|
// +build ignore
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
//go:build aix
|
||||||
// +build aix
|
// +build aix
|
||||||
|
|
||||||
package net
|
package net
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
//go:build darwin
|
||||||
// +build darwin
|
// +build darwin
|
||||||
|
|
||||||
package net
|
package net
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
//go:build !aix && !darwin && !linux && !freebsd && !openbsd && !windows
|
||||||
// +build !aix,!darwin,!linux,!freebsd,!openbsd,!windows
|
// +build !aix,!darwin,!linux,!freebsd,!openbsd,!windows
|
||||||
|
|
||||||
package net
|
package net
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
//go:build freebsd
|
||||||
// +build freebsd
|
// +build freebsd
|
||||||
|
|
||||||
package net
|
package net
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
//go:build linux
|
||||||
// +build linux
|
// +build linux
|
||||||
|
|
||||||
package net
|
package net
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
//go:build openbsd
|
||||||
// +build openbsd
|
// +build openbsd
|
||||||
|
|
||||||
package net
|
package net
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
//go:build freebsd || darwin
|
||||||
// +build freebsd darwin
|
// +build freebsd darwin
|
||||||
|
|
||||||
package net
|
package net
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
//go:build windows
|
||||||
// +build windows
|
// +build windows
|
||||||
|
|
||||||
package net
|
package net
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
//go:build darwin
|
||||||
// +build darwin
|
// +build darwin
|
||||||
|
|
||||||
package process
|
package process
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
// +build darwin
|
//go:build darwin && arm64
|
||||||
// +build arm64
|
// +build darwin,arm64
|
||||||
|
|
||||||
// Code generated by cmd/cgo -godefs; DO NOT EDIT.
|
// Code generated by cmd/cgo -godefs; DO NOT EDIT.
|
||||||
// cgo -godefs process/types_darwin.go
|
// cgo -godefs process/types_darwin.go
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
// +build darwin
|
//go:build darwin && cgo
|
||||||
// +build cgo
|
// +build darwin,cgo
|
||||||
|
|
||||||
package process
|
package process
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
// +build darwin
|
//go:build darwin && !cgo
|
||||||
// +build !cgo
|
// +build darwin,!cgo
|
||||||
|
|
||||||
package process
|
package process
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
//go:build !darwin && !linux && !freebsd && !openbsd && !windows
|
||||||
// +build !darwin,!linux,!freebsd,!openbsd,!windows
|
// +build !darwin,!linux,!freebsd,!openbsd,!windows
|
||||||
|
|
||||||
package process
|
package process
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
//go:build freebsd
|
||||||
// +build freebsd
|
// +build freebsd
|
||||||
|
|
||||||
package process
|
package process
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
// +build freebsd
|
//go:build freebsd && arm64
|
||||||
// +build arm64
|
// +build freebsd,arm64
|
||||||
|
|
||||||
// Code generated by cmd/cgo -godefs; DO NOT EDIT.
|
// Code generated by cmd/cgo -godefs; DO NOT EDIT.
|
||||||
// cgo -godefs process/types_freebsd.go
|
// cgo -godefs process/types_freebsd.go
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
//go:build linux
|
||||||
// +build linux
|
// +build linux
|
||||||
|
|
||||||
package process
|
package process
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
//go:build openbsd
|
||||||
// +build openbsd
|
// +build openbsd
|
||||||
|
|
||||||
package process
|
package process
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
// +build openbsd
|
//go:build openbsd && 386
|
||||||
// +build 386
|
// +build openbsd,386
|
||||||
|
|
||||||
// Code generated by cmd/cgo -godefs; DO NOT EDIT.
|
// Code generated by cmd/cgo -godefs; DO NOT EDIT.
|
||||||
// cgo -godefs process/types_openbsd.go
|
// cgo -godefs process/types_openbsd.go
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
//go:build linux || freebsd || openbsd || darwin
|
||||||
// +build linux freebsd openbsd darwin
|
// +build linux freebsd openbsd darwin
|
||||||
|
|
||||||
package process
|
package process
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
//go:build windows
|
||||||
// +build windows
|
// +build windows
|
||||||
|
|
||||||
package process
|
package process
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
//go:build windows
|
||||||
// +build windows
|
// +build windows
|
||||||
|
|
||||||
package process
|
package process
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
//go:build windows
|
||||||
// +build windows
|
// +build windows
|
||||||
|
|
||||||
package process
|
package process
|
||||||
|
|
|
@ -5,6 +5,7 @@
|
||||||
// Hand Writing
|
// Hand Writing
|
||||||
// - all pointer in ExternProc to uint64
|
// - all pointer in ExternProc to uint64
|
||||||
|
|
||||||
|
//go:build ignore
|
||||||
// +build ignore
|
// +build ignore
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
//go:build ignore
|
||||||
// +build ignore
|
// +build ignore
|
||||||
|
|
||||||
// We still need editing by hands.
|
// We still need editing by hands.
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
//go:build ignore
|
||||||
// +build ignore
|
// +build ignore
|
||||||
|
|
||||||
// We still need editing by hands.
|
// We still need editing by hands.
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
//go:build (darwin || freebsd || openbsd || netbsd || dragonfly) && !appengine
|
||||||
// +build darwin freebsd openbsd netbsd dragonfly
|
// +build darwin freebsd openbsd netbsd dragonfly
|
||||||
// +build !appengine
|
// +build !appengine
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
//go:build appengine || js || nacl || wasm
|
||||||
// +build appengine js nacl wasm
|
// +build appengine js nacl wasm
|
||||||
|
|
||||||
package isatty
|
package isatty
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
//go:build plan9
|
||||||
// +build plan9
|
// +build plan9
|
||||||
|
|
||||||
package isatty
|
package isatty
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
// +build solaris
|
//go:build solaris && !appengine
|
||||||
// +build !appengine
|
// +build solaris,!appengine
|
||||||
|
|
||||||
package isatty
|
package isatty
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
//go:build (linux || aix) && !appengine
|
||||||
// +build linux aix
|
// +build linux aix
|
||||||
// +build !appengine
|
// +build !appengine
|
||||||
|
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue