0

My Goland IDE on Mac doesn't understand -> syntax = "proto3" do you know why?

package expected, got syntax

Either I put the syntax before or after the package declaration, it doesn't change nothing...

My example.proto file looks like

syntax = "proto3";

package main;

service Greeter {
rpc login (HelloRequest) returns (HelloReply) {}
rpc logging (HelloRequest) returns (HelloReply) {}
}

message HelloRequest{
string ID=1;
}

message HelloReply{
string response=1;
}

I already tried this solution but nothing happened the error remains as it is :

Solution -

  • Close Goland
  • Remove the .idea folder -> rm -rf .idea
  • reopen the project with Goland

Anyone has any other solution please help.

Vitaly Isaev
  • 5,392
  • 6
  • 45
  • 64

1 Answers1

1

Most likely you either associated all .proto files with the Go extension or just that particular file.

To check it, go to Settings/Preferences | Editor | File Types | Go and check the registered patterns there.

dlsniper
  • 7,188
  • 1
  • 35
  • 44