From 2bd33358839ada826ae56baf1d4eb396d1d0207a Mon Sep 17 00:00:00 2001 From: hellodword <46193371+hellodword@users.noreply.github.com> Date: Tue, 6 Aug 2024 03:16:50 +0000 Subject: [PATCH] add go tags to make LSP happy (removing main redeclared error) --- Makefile | 2 +- main_dynamic.go | 2 ++ main_static.go | 2 ++ 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 9b1c23b..6a67ebe 100644 --- a/Makefile +++ b/Makefile @@ -18,7 +18,7 @@ build-dynamic: build-static: @cd lib/hello && cargo build --release @cp lib/hello/target/release/libhello.a lib/ - go build main_static.go + go build -tags static main_static.go .PHONY: run-dynamic run-dynamic: build-dynamic diff --git a/main_dynamic.go b/main_dynamic.go index 00baac4..eee9e13 100644 --- a/main_dynamic.go +++ b/main_dynamic.go @@ -1,3 +1,5 @@ +//go:build !static + package main // NOTE: There should be NO space between the comments and the `import "C"` line. diff --git a/main_static.go b/main_static.go index 1803453..4b2295c 100644 --- a/main_static.go +++ b/main_static.go @@ -1,3 +1,5 @@ +//go:build static + package main // NOTE: There should be NO space between the comments and the `import "C"` line.