faiface / pixel

A hand-crafted 2D game library in Go
MIT License
4.46k stars 245 forks source link

Issue in pixelgl, can not import "." package? #275

Open TheFlowDevelopment opened 3 years ago

TheFlowDevelopment commented 3 years ago

i have a code like this for my idie game:

package main

import (
    "github.com/faiface/pixel"
    "github.com/faiface/pixel/pixelgl"
)

func run() {
    // all of our code will be fired up from here
    cfg := pixelgl.WindowConfig{
        Title:  "Pixel Rocks!",
        Bounds: pixel.R(0, 0, 1024, 768),
    }
    win, err := pixelgl.NewWindow(cfg)
    if err != nil {
        panic(err)
    }
    for !win.Closed() {
        win.Update()
    }
}

func main() {
    pixelgl.Run(run)
}

But if i build the main.go OR run the file i getting this issue: cannot find package "." in: C:\Go\src\github.com\faiface\pixel\pixelgl

i tryed: go get github.com\faiface\pixel\pixelgl and go get github.com\faiface\pixel

Asday commented 3 years ago

Just a sidenote - if you want to post a multiline code snippet, you need to use triple backticks to make it a code block:

like
this

(You can click "quote reply" in the menu at the top-right of my comment to see what that looks like before formatting).

TheFlowDevelopment commented 3 years ago

Just a sidenote - if you want to post a multiline code snippet, you need to use triple backticks to make it a code block:

like
this

(You can click "quote reply" in the menu at the top-right of my comment to see what that looks like before formatting).

ok. got it. So whats the problem?

Asday commented 3 years ago

My apologies, I'm not in a position to try it out right now, just wanted to help you improve your question so the future answerer has an easier time. Good luck!

dusk125 commented 3 years ago

Can you post the value of your GOPATH and GOROOT please?

darkerbess commented 3 years ago

Could you solve it? I have the same problem

Edit: nevermind, it was just the $GOPATH

dusk125 commented 3 years ago

@TheFlowDevelopment are you still having issues? If so, please post your GOPATH AND GOROOT; if not, please close this issue. Thanks!