Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

internal compiler error #400

Open
ningmingxiao opened this issue Jul 26, 2024 · 1 comment
Open

internal compiler error #400

ningmingxiao opened this issue Jul 26, 2024 · 1 comment

Comments

@ningmingxiao
Copy link

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

@godcong
Copy link

godcong commented Sep 2, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants