flatbuffers icon indicating copy to clipboard operation
flatbuffers copied to clipboard

Go generator undefined behavior

Open enum-class opened this issue 2 years ago • 0 comments

In cases that fbs file not defined namespace Go generator has undefined behavior, It generate file with blank package. plus not import files properly because their package name is empty. For instance:

foo.fbs:

include "header.fbs";

namespace myspace;

table Food1 {
  haye_1: JAFAF;
}

header.fbs

table JAFAF {
  dodol: int;
}

It will generate correspondent files :

Food1.go

 // Code generated by the FlatBuffers compiler. DO NOT EDIT.

package myspace

import (
	flatbuffers "github.com/google/flatbuffers/go"

	 ""
)

type Food1 struct {
	_tab flatbuffers.Table
} ...

JAFAF.go

// Code generated by the FlatBuffers compiler. DO NOT EDIT.

package 

import (
	flatbuffers "github.com/google/flatbuffers/go"
)

type JAFAF struct {
	_tab flatbuffers.Table
}

enum-class avatar Nov 09 '22 04:11 enum-class