Skip to content

Commit

Permalink
naming
Browse files Browse the repository at this point in the history
  • Loading branch information
mfridman committed Mar 22, 2024
1 parent 4f607eb commit d44da1e
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions internal/protoschema/plugin/pluginbigquery/pluginbigquery.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@ func Handle(
for i := range fileDescriptor.Messages().Len() {
messageDescriptor := fileDescriptor.Messages().Get(i)

tableName := tryGetTableNameFromOptions(messageDescriptor)
if tableName == "" {
tableName = string(messageDescriptor.Name())
tablename := tryGetTableNameFromOptions(messageDescriptor)
if tablename == "" {
tablename = string(messageDescriptor.Name())
}
schema, _, err := bigquery.Generate(messageDescriptor)
if err != nil {
Expand All @@ -56,10 +56,10 @@ func Handle(
if len(data) == 0 || string(data) == "null" {
continue
}
name := tableName + "." + bigquery.FileExtension
filename := strings.ReplaceAll(string(fileDescriptor.Package()), ".", "/")
basename := tablename + "." + bigquery.FileExtension
dirPath := strings.ReplaceAll(string(fileDescriptor.Package()), ".", "/")
responseWriter.AddFile(
filepath.Join(filename, name),
filepath.Join(dirPath, basename),
string(data),
)
}
Expand Down

0 comments on commit d44da1e

Please sign in to comment.