<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>工作目录 on PlumePHP</title><link>https://plumephp.com/tags/%E5%B7%A5%E4%BD%9C%E7%9B%AE%E5%BD%95/</link><description>Recent content in 工作目录 on PlumePHP</description><generator>Hugo</generator><language>zh-CN</language><lastBuildDate>Wed, 13 Aug 2025 10:00:00 +0800</lastBuildDate><atom:link href="https://plumephp.com/tags/%E5%B7%A5%E4%BD%9C%E7%9B%AE%E5%BD%95/index.xml" rel="self" type="application/rss+xml"/><item><title>Go 工作目录入门：为什么本地能读到文件，部署后却找不到</title><link>https://plumephp.com/go-working-directory-paths-2025/</link><pubDate>Wed, 13 Aug 2025 10:00:00 +0800</pubDate><guid>https://plumephp.com/go-working-directory-paths-2025/</guid><description>&lt;p&gt;&amp;ldquo;本地能跑，部署后找不到文件&amp;quot;是 Go 初学者最常见的问题之一。你写了一个Web服务，在本地开发环境中通过 &lt;code&gt;go run ./cmd/server&lt;/code&gt; 启动，一切正常。部署到远程服务器后，日志里突然出现了 &lt;code&gt;open templates/index.html: no such file or directory&lt;/code&gt;。代码没有变，二进制也没有报错，只是服务启动的当前工作目录不同，导致相对路径失效。&lt;/p&gt;</description></item></channel></rss>