Proto File Setup

The starting .proto file for the link shortener service.

syntax = "proto3";

package shortener;

option go_package = "shortener/pb";

message Link {
  int64 id = 1;
  string url = 2;
  string short_code = 3;
  int64 clicks = 4;
}
mkdir shortener && cd shortener
go mod init shortener
mkdir proto
# save the above as proto/link.proto

💻 Run locally

Copy the code above and run it on your machine

© 2026 ByteLearn.dev. Free courses for developers. · Privacy