easyjson icon indicating copy to clipboard operation
easyjson copied to clipboard

easyjson didn't generate all data. MFTI/perfomance/json example

Open RomanAvdeenko opened this issue 2 years ago • 1 comments

Hi. My golang version is go1.18.3 linux/amd64

I ran the command: rav@PC:~/Go/MFTI/perfomance/json$ easyjson struct.go And got an error: # command-line-arguments main.main: relocation target type.json_test.EasyJSON_exporter_User not defined Bootstrap failed: exit status 2

File struct_easyjson.go has only lines: // TEMPORARY AUTOGENERATED FILE: easyjson stub code to make the package // compilable during generation.

_package main

import ( "github.com/mailru/easyjson/jwriter" "github.com/mailru/easyjson/jlexer" )

func ( User ) MarshalJSON() ([]byte, error) { return nil, nil } func (* User ) UnmarshalJSON([]byte) error { return nil } func ( User ) MarshalEasyJSON(w jwriter.Writer) {} func ( User ) UnmarshalEasyJSON(l *jlexer.Lexer) {}

type EasyJSON_exporter_User *User__

RomanAvdeenko avatar Jun 09 '22 22:06 RomanAvdeenko

Try to move your go file into it's own package, It worked for me

zenoleg avatar Oct 01 '22 11:10 zenoleg