Skip to content

Commit f4e26d7

Browse files
committed
fix: validate formatting with the selected Go toolchain
Signed-off-by: rldyourmnd <danil@nddev.it.com>
1 parent df4937e commit f4e26d7

2 files changed

Lines changed: 10 additions & 7 deletions

File tree

‎core/workspace/device.go‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -173,12 +173,12 @@ func ResolvePlacement(
173173
}
174174
if len(matches) == 0 {
175175
return Placement{
176-
DeviceID: descriptor.Device.ID, RepositoryID: anchor.Repository.ID,
177-
Mode: descriptor.Materialization.DefaultMode,
178-
}, []domain.Finding{workspaceFinding(
179-
"GDS_WORKSPACE_PLACEMENT_NOT_SELECTED",
180-
"Repository does not match a device materialization assignment.", anchor.Repository.ID,
181-
)}
176+
DeviceID: descriptor.Device.ID, RepositoryID: anchor.Repository.ID,
177+
Mode: descriptor.Materialization.DefaultMode,
178+
}, []domain.Finding{workspaceFinding(
179+
"GDS_WORKSPACE_PLACEMENT_NOT_SELECTED",
180+
"Repository does not match a device materialization assignment.", anchor.Repository.ID,
181+
)}
182182
}
183183
if len(matches) != 1 {
184184
return Placement{}, []domain.Finding{workspaceFinding(

‎scripts/validate_go_core.sh‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,10 @@ fi
6767
BUILD_DIR=$(mktemp -d "${TMPDIR:-/tmp}/gds-build.XXXXXX")
6868
trap 'rm -rf -- "$BUILD_DIR"' EXIT INT TERM
6969

70-
UNFORMATTED=$(gofmt -l core schemas/embed.go)
70+
# GOTOOLCHAIN selects `go`, but does not replace a separate `gofmt` on PATH.
71+
# Use the formatter shipped with the exact toolchain this gate just verified.
72+
GOFMT="$(go env GOROOT)/bin/gofmt"
73+
UNFORMATTED=$("$GOFMT" -l core schemas/embed.go)
7174
if [ -n "$UNFORMATTED" ]; then
7275
printf 'gofmt required for:\n%s\n' "$UNFORMATTED" >&2
7376
exit 2

0 commit comments

Comments
 (0)