easyjson icon indicating copy to clipboard operation
easyjson copied to clipboard

internal compiler error

Open ningmingxiao opened this issue 1 year ago • 1 comments

run.go

package main

import (
        "fmt"

        "github.com/mailru/easyjson"
        // "github.com/mailru/easyjson/gen"
)

//easyjson:json
type Person struct {
        Name    string `json:"name"`
        Age     int    `json:"age"`
        Email   string `json:"email,omitempty"`
        Address string `json:"-"`
}

func main() {
        p := Person{
                Name:    "John Doe",
                Age:     30,
                Email:   "[email protected]",
                Address: "123 Elm Street",
        }
        rawBytes, err := easyjson.Marshal(p)
        fmt.Println(err)
        println(rawBytes)
        fmt.Println("11111111")
}

root@LIN-FB738BFD367 test]# easyjson -all run.go 
# command-line-arguments
<unknown line number>: internal compiler error: have package "main" (0xc000144280), want package "run.go" (0xc00044c690)

Please file a bug report including a short program that triggers the error.
https://go.dev/issue/new
Bootstrap failed: exit status 1

[root@test]# go version go version go1.21.12 linux/amd64

ningmingxiao avatar Jul 26 '24 06:07 ningmingxiao

It looks like it doesn't support generating from the main package

godcong avatar Sep 02 '24 10:09 godcong

dont use main package

rvasily avatar Dec 14 '24 18:12 rvasily