Skip to content

Conversation

hiranya911
Copy link
Contributor

Also bumped the minimum Go version to 1.12.

Copy link
Member

@lahirumaramba lahirumaramba left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! LGTM!

@hiranya911 hiranya911 changed the title fix: Checked and updated import path comments fix: Removed import path comments Jun 12, 2020
@hiranya911
Copy link
Contributor Author

After a bit of experimentation it seems the safest option is to remove the import paths altogether.

1. Import paths are not used when used as a module.

From https://golang.org/cmd/go/#hdr-Remote_import_paths

Import path checking is also disabled when using modules. Import path comments are obsoleted by the go.mod file's module statement.

2. Having import paths set to the versioned (/v4) package names break compilation when used in the non-module mode.

package main

import (
        "context"
	firebase "firebase.google.com/go"
)

func main() {
	app, err := firebase.NewApp(context.Background(), nil)
	// ...
}
main.go:8:2: code in directory gopath/src/firebase.google.com/go expects import "firebase.google.com/go/v4"

The import path is basically making it impossible for non-modules users to import the code.

Copy link
Member

@lahirumaramba lahirumaramba left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense! Thanks for checking!

@hiranya911 hiranya911 merged commit 38e9443 into dev Jun 12, 2020
@hiranya911 hiranya911 deleted the hkj-import-paths branch June 12, 2020 19:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants