douyuan6490 2016-02-18 18:57
浏览 361

在intellij中调试golang-找不到相关文件

I'm working on a golang project that has to read files from a sub directory...

When debugging my program it (not sure what it is yet) is unable to locate the files when provided a relative path. Im using io.util.ReadFile(RELATIVE_PATH) for this operation.

This problem doesn't occur when running the program from the terminal.

This has lead me to believe intellij does something behind the scenes debugging/running where it messes with the directory structure (moves it into a temporary location?). If this is the case, how would I go about configuring intellij so that the sub directories are included in the magic or removing the magic so the program is debugged from the directory it lives in.

I'm new to golang/intellij so any help would be appreciated.

  • 写回答

1条回答 默认 最新

  • duanjiao8007 2016-02-18 20:52
    关注

    Click on "Edit Configurations"

    enter image description here

    and change the "Working directory" path to where your program should "live in".

    enter image description here

    评论

报告相同问题?

悬赏问题

  • ¥15 无线电能传输系统MATLAB仿真问题
  • ¥50 如何用脚本实现输入法的热键设置
  • ¥20 我想使用一些网络协议或者部分协议也行,主要想实现类似于traceroute的一定步长内的路由拓扑功能
  • ¥30 深度学习,前后端连接
  • ¥15 孟德尔随机化结果不一致
  • ¥15 apm2.8飞控罗盘bad health,加速度计校准失败
  • ¥15 求解O-S方程的特征值问题给出边界层布拉休斯平行流的中性曲线
  • ¥15 谁有desed数据集呀
  • ¥20 手写数字识别运行c仿真时,程序报错错误代码sim211-100
  • ¥15 关于#hadoop#的问题