英文:
Visual Studio Code - Golang does not recognize import of html/template
问题
完全不熟悉Visual Studio Code和Go语言...
尝试浏览一个代码示例,其中需要导入"html/template" -- 但是,当我尝试将"html/template"添加到导入列表时,Visual Studio Code显示如下(屏幕截图):
无论我做什么(例如:保存文件),Visual Studio Code都会删除包含"html/template"的行 -- 如何添加导入指令?
提前感谢。
英文:
Completely new to Visual Studio Code and Go ...
Trying to walk through a code sample, which requires the import of "html/template" -- however, Visual Studio Code shows the following (screen snapshot) when I try to add "html/template" to the import list:
No matter what I do, (i.e.: save the file) -- Visual Studio Code deletes the line containing "html/template" -- HOW do you add an import directive???
Thanks in advance.
答案1
得分: -1
@mkopriva - 谢谢 - 天哪 - 是的 - 我在按照教程进行操作 - 教程要求在导入列表中插入 "html/template" - 但是 - 我还没有添加任何引用该包的代码行 - 因此编辑器报错 - 这是一个会让完全新手困惑的简单问题。
英文:
@mkopriva - Thanks -- Good Grief - yes - was following the tutorial -- which asked to insert "html/template" in the import list -- BUT -- I had not yet added any lines of code that referenced that package -- hence the "error" by the editor -- something simple that would trip up a complete newbie.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论