Skip to content

Potential bug with golang 1.13, fmt.Println returns printed text plus <nil> #179

@Mathis001

Description

@Mathis001

I'm running into an interesting bug that may be related to the newest version of golang (version 1.13 released 9/3). I can get gophernotes installed, and it works as a kernel, but doing a hello world test returns some extraneous results.

[1]:    import "fmt"
[2]:    fmt.Println("hello world")
        hello world
[2]:    12 <nil>

What's interesting is the number appears to be the number of characters + 1. Here is another result showing the number changing:

[1]:    import "fmt"
[2]:    fmt.Println("test")
        test
[2]:    5 <nil>

This happens both in a notebook, and in the console view in Jupyter Lab. I can supply screenshots of this or any other logs as necessary. I ran a similar go file from the command line to confirm this isn't an issue with my golang install:

// helloworld.go
package main
import "fmt"

func main() {
    fmt.Println("hello world")
}
$ go run helloworld.go
hello world

Here is the relevant information to help duplicate this issue:

OS Info:

Ubuntu 18.04
4.15.0-60-generic

ZeroMQ 4.X.X Info:

libzmq3-dev is already the newest version (4.2.5-1ubuntu0.2)

golang 1.13 info:

$ go version
go version go1.13 linux/amd64
$ go env
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/jupyter/.cache/go-build"
GOENV="/home/jupyter/.config/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/home/jupyter/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD=""
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build422422188=/tmp/go-build -gno-record-gcc-switches"

Jupyter info:

$ jupyter --version
jupyter core     : 4.5.0
jupyter-notebook : not installed
qtconsole        : not installed
ipython          : 5.8.0
ipykernel        : 4.10.1
jupyter client   : 5.3.1
jupyter lab      : not installed
nbconvert        : 5.3.1
ipywidgets       : not installed
nbformat         : 4.4.0
traitlets        : 4.3.2

I'd appreciate any help with this, thanks!

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