-
Notifications
You must be signed in to change notification settings - Fork 17.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
os: IsDir reports false for OneDrive hosted volumes. #22434
Comments
What command did you run? And where did you run it? And where is the code you posted located (filename and path)? |
I tried both ‘go run xxxx.go’ and ‘go build xxxx.go’ , however both failed
with errors like that.
Now, not only this file,all my other files raise error like this one. I
guess there is something wrong with my go program?
On Wed, Oct 25, 2017 at 11:54 PM Alberto Donizetti ***@***.***> wrote:
What command did you run?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#22434 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/ADPo2Kkp5nv8YxpinMLrN3HA6mBQMzKOks5sv1nJgaJpZM4QGLsX>
.
--
from Kanch's Gmail
|
There must be something wrong with your Go toolchain and/or your environment. I suggest you remove everything and reinstall Go, that may fix your issue. If you need help, please see the Questions wiki page; it has a list of good places for asking questions (we only use the github issue tracker for tracking confirmed bugs, and I think the issue here is in your environment). I'm closing this, but we can always re-open later if it turns out this was a Go bug. |
I hope that's not your password, but if it is, you should change it quick :( |
According to your picture, you build your program with "Visual Studio Code". But this issue list does not for "Visual Studio Code" support. You have to show the command that you run ("go build" or whatever) to get that error message. Did you read https://golang.org/doc/code.html ? Did you follow what is suggested there before trying to use "Visual Studio Code" ? Alex |
@ankanch I tried reproducing your error, and I cannot. Do you have test.go file in d:\onedrive\projects\project-go\practice ? What is the contents of test.go file? Alex |
@alexbrainman Here's my BTW,I have resolved this problem by delete Is the "." package stands for current directory? Thanks anyway. |
You cannot write this statement.
import “.”
As it would create an recursive import loop with the current package.
… On 26 Oct 2017, at 19:51, hcnak ***@***.***> wrote:
@alexbrainman Here's my practice folder and contents oftest.go`.
BTW,I have resolved this problem by delete practice folder and recreate it as well as test.go.
That's wired.
Is the "." package stands for current directory?
Thanks anyway.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.
|
Okay, thank you.
Then that would be very wired that I have NOT import package ".", but it
give my the error "package . not found" .
On Thu, Oct 26, 2017 at 5:05 PM, Dave Cheney <notifications@github.com>
wrote:
… You cannot write this statement.
import “.”
As it would create an recursive import loop with the current package.
> On 26 Oct 2017, at 19:51, hcnak ***@***.***> wrote:
>
>
> @alexbrainman Here's my practice folder and contents oftest.go`.
>
> BTW,I have resolved this problem by delete practice folder and recreate
it as well as test.go.
> That's wired.
>
> Is the "." package stands for current directory?
>
> Thanks anyway.
>
> —
> You are receiving this because you are subscribed to this thread.
> Reply to this email directly, view it on GitHub, or mute the thread.
>
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#22434 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/ADPo2GRstJq_gCJc8Hgn2iccGHTo_OEFks5swEtagaJpZM4QGLsX>
.
--
Best regards,
*Long Zhang (Kanch) <http://akakanch.com> *@ Chengdu University of Information
Technology
2015 Computer Science Major
Mail:kanchisme@gmail.com
No.24 Block 1, Xuefu Road, Chengdu, Sichuan, China
|
Please show a complete code sample that reproduces the issue so that we can see for ourselves.
… On 26 Oct 2017, at 20:08, hcnak ***@***.***> wrote:
Okay, thank you.
Then that would be very wired that I have NOT import package ".", but it
give my the error "package . not found" .
On Thu, Oct 26, 2017 at 5:05 PM, Dave Cheney ***@***.***>
wrote:
> You cannot write this statement.
>
> import “.”
>
> As it would create an recursive import loop with the current package.
>
> > On 26 Oct 2017, at 19:51, hcnak ***@***.***> wrote:
> >
> >
> > @alexbrainman Here's my practice folder and contents oftest.go`.
> >
> > BTW,I have resolved this problem by delete practice folder and recreate
> it as well as test.go.
> > That's wired.
> >
> > Is the "." package stands for current directory?
> >
> > Thanks anyway.
> >
> > —
> > You are receiving this because you are subscribed to this thread.
>
> > Reply to this email directly, view it on GitHub, or mute the thread.
> >
>
> —
> You are receiving this because you were mentioned.
> Reply to this email directly, view it on GitHub
> <#22434 (comment)>, or mute
> the thread
> <https://github.com/notifications/unsubscribe-auth/ADPo2GRstJq_gCJc8Hgn2iccGHTo_OEFks5swEtagaJpZM4QGLsX>
> .
>
--
Best regards,
*Long Zhang (Kanch) <http://akakanch.com> *@ Chengdu University of Information
Technology
2015 Computer Science Major
***@***.***
No.24 Block 1, Xuefu Road, Chengdu, Sichuan, China
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or mute the thread.
|
I get the same error on ubuntu 16.04 using liteide and go 1.9.1 |
it's a very wired problem ,I solved it by recreating the directory and
files.
…On Thu, Nov 16, 2017 at 6:44 PM, reza7rm ***@***.***> wrote:
I get the same error on ubuntu 16.04 using liteide and go 1.9.1
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#22434 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/ADPo2H-jwEZXvwaG7oARsLtGXU50V1Xpks5s3BIigaJpZM4QGLsX>
.
--
Best regards,
*Long Zhang (Kanch) <http://akakanch.com> *@ Chengdu University of Information
Technology
2015 Computer Science Major
Mail:kanchisme@gmail.com
No.24 Block 1, Xuefu Road, Chengdu, Sichuan, China
|
I had this issue as well (Windows 10 & go1.10). The error comes from not setting up your GOPATH in the environment variables See here in the installation docs and [here](https://github.com/golang/go/wiki/SettingGOPATH#windows for setting up your GOPATH). |
Hello, I know this issue has been closed, but I have encountered the same problem. I found that I cannot compile and run any go code in the OneDrive folder, but when I moved to another path, the problem solved. From go version go1.10.1 windows/amd64 $ cd C:\Users\mohan\OneDrive\sandbox && go run run.go
package main: cannot find package "." in:
C:\Users\mohan\OneDrive\sandbox
$ cp run.go C:\\tmp\\run.go && go run C:\\tmp\\run.go
Hello World! |
@mohanson from the comment above:
is |
@ALTree I did not set GOPATH. The Golang automatically creates a new folder named "go" in my user path, so since switch to the v1.10.x I will no longer set it. I just tried set GOPATH=MY_USER_PATH/go, the problem has not been solved. |
@ALTree I found Golang doesn't think the Onedrive folder(and any sub folder in it) is a directory, the IsDir() function returns False: package main
import (
"log"
"os"
)
func main() {
f, err := os.Open("C:\\Users\\mohan\\OneDrive\\sandbox")
if err != nil {
log.Fatalln(err)
}
i, err := f.Stat()
if err != nil {
log.Fatalln(err)
}
log.Println(i.IsDir())
// 2018/04/09 11:34:37 false
} But in python: I think this may be one of the reasons for the problem. |
/cc @alexbrainman I'm almost certain this is a duplicate of another OneDrive related issue. /cc @jessfraz do you know anyone inside Microsoft who might be able to assist. |
#22579 (os: IsDir doesn't work with Windows OneDrive), possibly? If that's the case, it should be fixed on tip (to be go1.11). |
Please answer these questions before submitting your issue. Thanks!
What version of Go are you using (
go version
)?go version go1.9.1 windows/amd64
Does this issue reproduce with the latest release?
YES
What operating system and processor architecture are you using (
go env
)?What did you do?
My code :
https://play.golang.org/p/1PkuUDceTO
I have searched below errors on Google, nothing helpful at all. What is " . " package? I written as
package main
instead. Where the " . " comes from?What did you expect to see?
Compiled or run with no errors.
What did you see instead?
package main: cannot find package "." in: D:\OneDrive\Projects\Project-Go\sendmail
The text was updated successfully, but these errors were encountered: