How to use package from Gitlab?

Hi all

I’ve generated a go file from proto file and hosts on

Then I tried to create a gRPC server as follows:

package main

import (

type server struct {


func (s *server) SignUp(ctx context.Context, in *Registration) (*Identity, error) {


func main() {


But the compiler complains:

./main.go:5:2: imported and not used: ""
./main.go:12:50: undefined: Registration
./main.go:12:66: undefined: Identity

I am using go mod to manage my modules and the folders are structured as follows:

enter image description here

The content of my go.mod file

module identity-service

go 1.14

require ( v1.3.4 // indirect v1.1.1 // indirect v4.1.14 // indirect v0.0.12 // indirect v0.1.2 v0.0.0-20200221231518-2aa609cf4a9d // indirect v0.0.0-20200226121028-0de0cce0169b // indirect v0.0.0-20200223170610-d5e6a3e2c0ae // indirect v1.27.1 // indirect

What am I doing wrong?


I think you need to use proto.Registration and proto.Identity? It’s been a while since I touched any Go code :slight_smile:

Hi @softshipper, As @flexd mentioned, did you try to call proto.Identity or proto.Registration? what is the result when you build?

1 Like

There is a short documentation about importing a package and using it. I believe it will help you to understand packages better.

Import declarations

@flexd has already given you the correct answer. Another solution is using . declaration and accessing exported indentifiers without a package qualifier.

import . ""

1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.