Skip to content

net/http: replace a statement in http.Error #71959

Closed as not planned
Closed as not planned
@Guest-615695028

Description

@Guest-615695028

In the Go function

func Error(w ResponseWriter, error string, code int)

, we can replace

fmt.Fprintln(w, error)

with

w.Write([]byte(error+"\n"))

to reduce stack occupation and improve speed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions