實時重新載入go應用

iamcyan發表於2020-12-30

簡介

1、可以實現go程式碼的 live-reload
2、基於 fresh 不在維護,開發了 air

特點

  • Colorful log output
  • Customize build or binary command
  • Support excluding subdirectories
  • Allow watching new directories after Air started
  • Better building process

安裝

go get -u github.com/cosmtrek/air

使用

air

輸出:

實時重新載入go應用

1、因為我本地沒有開啟MySQL服務,所以有連結報錯。
2、air 會檢測其他檔案的改動,一旦其他檔案改動之後,會自動進行編譯
3、air 和生產環境的熱部署無關。

本作品採用《CC 協議》,轉載必須註明作者和本文連結

相關文章