Skip to content
This repository has been archived by the owner on Jul 15, 2023. It is now read-only.
This repository has been archived by the owner on Jul 15, 2023. It is now read-only.

Could not import "..." with go modules #1953

Closed

Description

I created a go module and installed some deps with:

go mod init github.com/affanshahid/hello-world
go get "github.com/fatih/color"

Wrote the following in main.go:

package main

import "github.com/fatih/color"

func main() {
	color.Cyan("Hello world")
}

When I run go build && ./hello-world, it runs fine. However when I go into vscode, I get the following:
screen shot 2018-10-01 at 1 37 42 pm

I'm not sure what I'm doing wrong

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    go-modulesRelated to Go modules

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions