0

I'm trying to build out a simple URL shortener in Go to get familiar with the language. As part of this I'm trying to use an underlying firebase datastore which I'm authenticating against using a Service Account.

After configuring the firestore client I tried to build for the first time and started encountering the following error

$ go build
# _/C_/Users/emmao/Documents/Go/UrlShortener
2020/05/10 17:52:18 C:\Users\emmao\go\pkg\windows_amd64\github.com\golang\protobuf\ptypes.a(_go_.o): error reading symbol: EOF

After stripping back chunks of code, this is the minimum amount required to reproduce the issue:

package main

import (
    "fmt"

    "google.golang.org/api/option"
)

func main() {
    // Use a service account
    sa := option.WithCredentialsFile("path/to/serviceAccount.json")

    fmt.Println(sa)
}

I'm a bit lost with it to be honest. I'm getting no syntax highlighting to indicate I've done anything wrong. And while this is an early project for me with I've built some other simple stuff which required external imports and they worked okay.

I'm using a Windows PC with Visual Studio Code as an IDE. Tried both CRLF and LF line endings. I also tried just rewriting the file again from scratch using vanilla notepad and encountered the same problem.

The extensions I have on VS code are underlining package main and showing the same error as I get on build.

Anybody encountered anything like this before?

EmmaO91
  • 408
  • 1
  • 4
  • 18

1 Answers1

0

your code is fine i test it on my mac, but it can be some outsider causes, for example: windows firewall - which blocked requests to download some go packages

see this similar issues:

  1. https://github.com/PaloAltoNetworks/pango/issues/11#issuecomment-492211040

  2. Go failing - expected 'package', found 'EOF'

sometimes in similar situations i got inconspicuous notifications about blocked process, etc in taskbar or small window on desktop , so you need to check your environment

peakle
  • 149
  • 5