Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

github.com/alparslankaraguney/hot-reload-go

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/alparslankaraguney/hot-reload-go

  • v0.0.0-20230311121611-d64e7750be74
  • Source
  • Go
  • Socket score

Version published
Created
Source

This is a working example of cosmtrek air for go hot reload.

This example shows how to properly setup cosmtrek air library for your go project. It also shows how to use .env file in this setup. Currently i managed to get env variables using a third part library so that .env file autmatically set on project start. I hope it will help some one...

First you must get the library:

go get -u github.com/cosmtrek/air

Then type to create .air.toml file:

air init

Edit .air.toml file for your project. For example i have to edit following lines to run correctly for this project setup:

First i have to edit cmd:

From:

"cmd = "go build -o ./tmp/main.exe ."

To:

cmd = "go build -o ./tmp/main.exe ./cmd/"

Since i run this example in windows i did not changed bin command in .air.toml file but in different operating systems you my also have to change this one. Mine as follows for this project setup: (care for \\ this might change)

bin = "tmp\\main.exe"

FAQs

Package last updated on 11 Mar 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc