Skip to content

net/http: Response.Status text include "number:" prefix in WebAssembly #31736

Closed
@dmitshur

Description

@dmitshur

What version of Go are you using (go version)?

$ go version
go version devel +50ad094 Sun Apr 28 23:51:04 2019 +0000 darwin/amd64

Does this issue reproduce with the latest release?

No.

What operating system and processor architecture are you using (go env)?

GOOS=js GOARCH=wasm

What did you do?

I compiled this program into WebAssembly and ran it in a browser:

package main

import (
	"fmt"
	"log"
	"net/http"
)

func main() {
	resp, err := http.Get("/")
	if err != nil {
		log.Fatalln(err)
	}
	defer resp.Body.Close()
	fmt.Println(resp.Status)
}

What did you expect to see?

200 OK

What did you see instead?

<number: 200> OK

Cause

This is happening after #29642 (comment) was implemented in CL 169757. We can't use the String() method on non-string JavaScript types as a fmt.Sprint shortcut anymore.

/cc @neelance @bradfitz @gabbifish

Metadata

Metadata

Assignees

No one assigned

    Labels

    FrozenDueToAgeNeedsFixThe path to resolution is known, but the work has not been done.arch-wasmWebAssembly issues

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions