文件无法上传
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x270 pc=0xb3b176]
goroutine 1 [running]:
github.com/tickstep/aliyunpan/internal/command.parseDriveId(0xc000638840, 0x2, 0xc00027f0e0)
/Users/tickstep/Documents/Workspace/go/projects/aliyunpan/internal/command/command.go:70 +0x36
github.com/tickstep/aliyunpan/internal/command.CmdUpload.func1(0xc000638840 , 0x13a92c0, 0xc000816ab0)
/Users/tickstep/Documents/Workspace/go/projects/aliyunpan/internal/command/upload.go:196 +0x1d9
github.com/urfave/cli.HandleAction(0xbd6800, 0xd157f0, 0xc000638840, 0xc000638840, 0x0)
/Users/tickstep/Applications/go/pkg/mod/github.com/urfave/[email protected]/app.go:523 +0x105
github.com/urfave/cli.Command.Run(0xcdae31, 0x6, 0x0, 0x0, 0xc000866c90, 0x1, 0x1, 0xce4fc5, 0x13, 0xc000845880, ...)
/Users/tickstep/Applications/go/pkg/mod/github.com/urfave/[email protected]/command.go:174 +0x579
github.com/urfave/cli.(*App).Run(0xc0002b4380, 0xc00033c040, 0x4, 0x4, 0x0, 0x0)
/Users/tickstep/Applications/go/pkg/mod/github.com/urfave/[email protected]/app.go:276 +0x7e8
main.main()
/Users/tickstep/Documents/Workspace/go/projects/aliyunpan/main.go:634 +0x1587
env: ubuntu 18.04
该报错为用户未登录时尝试进行文件操作时报错 可以添加相关判断来引导用户去登录
panic: runtime error: invalid memory address or nil pointer dereference [signal SIGSEGV: segmentation violation code=0x1 addr=0x40 pc=0x16ddd5a]
goroutine 65 [running]: github.com/tickstep/aliyunpan/internal/syncdrive.(*FileActionTask).DoAction(0xc00060e000, 0x19de738, 0xc000296280, 0x0, 0x0) /Users/tickstep/Documents/Workspace/go/projects/aliyunpan/internal/syncdrive/file_action_task.go:101 +0x1dfa github.com/tickstep/aliyunpan/internal/syncdrive.(*FileActionTaskManager).fileActionTaskExecutor.func1(0xc00060e000, 0x19de738, 0xc000296280, 0xc000148460, 0xc00020c090) /Users/tickstep/Documents/Workspace/go/projects/aliyunpan/internal/syncdrive/file_action_task_mgr.go:819 +0x45 created by github.com/tickstep/aliyunpan/internal/syncdrive.(*FileActionTaskManager).fileActionTaskExecutor /Users/tickstep/Documents/Workspace/go/projects/aliyunpan/internal/syncdrive/file_action_task_mgr.go:818 +0x30d
@HuanLinOTO 感谢,先在aliyunpan中login就解决了