Commit Graph

8 Commits

Author SHA1 Message Date
Martin Atkins
b2c20bda29 flock: Partially-manual modernization of waitgroup usage
The "go fix" modernizer for using wg.Go instead of explicit wg.Add/wg.Done
only works when the goroutine function has no arguments, so it didn't match
here where this code was still using an old trick to ensure that each
goroutine would capture a different value of "i".

But that old trick isn't needed anymore because modern Go already ensures
that each iteration of the loop has an independent "i", so I made a small
change to remove the argument and just let the closure capture "i" from
the outer loop, and then "go fix" was able to complete the rewrite to
use wg.Go here.

Signed-off-by: Martin Atkins <mart@degeneration.co.uk>
2026-03-17 15:25:09 -07:00
Martin Atkins
2b85803b7d flock: go fix
This is just the result of running the "go fix" modernizers against this
package.

It seems that there were some lines with trailing whitespace previously,
which also got removed here because "go fix" includes an implicit "go fmt".

Signed-off-by: Martin Atkins <mart@degeneration.co.uk>
2026-03-17 15:25:09 -07:00
baa-ableton
c3fe83a177 create automated tests for the internal/flock package (#3366)
Signed-off-by: Babur Ayanlar <babur.ayanlar@ableton.com>
2025-12-02 12:07:25 -03:00
Diógenes Fernandes
530e5c4538 Fix linting on Windows (#3457)
Signed-off-by: Diogenes Fernandes <diofeher@gmail.com>
Signed-off-by: Diógenes Fernandes <diofeher@gmail.com>
Co-authored-by: Martin Atkins <mart@degeneration.co.uk>
2025-12-02 07:11:14 -03:00
Martin Atkins
068df07d11 various: Remove legacy "+build" comments
Go 1.17 and earlier used a different syntax for build constraint comments,
starting with "+build". Go 1.18 changed this to the modern "go:build" form
as part of standardizing the structure of toolchain directive comments,
and so for a while it was convention to include comments in both styles
to allow building with both old and new Go compilers.

However, Go 1.17 is no longer supported, and regardless of that we only
expect OpenTofu to be built with the specific version we have selected
in "go.mod" and ".go-version" anyway, so we no longer need the legacy form
of these comments: the all supported Go toolchains now support the new
form, which this commit retains.

golangci-lint v2.6.0 includes a check for this legacy form, so removing
this will also allow us to upgrade to a newer version of that linter
aggregator in a future commit.

Signed-off-by: Martin Atkins <mart@degeneration.co.uk>
2025-11-01 08:00:01 -03:00
Diógenes Fernandes
018bbc5089 fix windows tests at internal/backend/local (#3198)
Signed-off-by: Diogenes Fernandes <diofeher@gmail.com>
2025-08-28 12:18:42 -03:00
Christian Mesh
1d38fd69d8 Switch from polling to native blocking locking for the provider cache (#3090)
Signed-off-by: Christian Mesh <christianmesh1@gmail.com>
Signed-off-by: Martin Atkins <mart@degeneration.co.uk>
Co-authored-by: Martin Atkins <mart@degeneration.co.uk>
2025-08-01 10:17:33 -04:00
Christian Mesh
d0ee5a36a5 Provider plugin cache locking (#1878)
Signed-off-by: Christian Mesh <christianmesh1@gmail.com>
2025-04-25 09:39:17 -04:00