From 3b92e99f43354ffc784ba7c23540add2adb3dba6 Mon Sep 17 00:00:00 2001 From: Kranex Date: Mon, 20 Mar 2023 21:32:29 +0100 Subject: [PATCH] fix: only skew lines that begin with G1 or G2 (ignoring indentation) --- goskew.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/goskew.go b/goskew.go index 09ae8cf..4bab36d 100644 --- a/goskew.go +++ b/goskew.go @@ -59,7 +59,7 @@ func skew(input []byte, xytan float64, xztan float64, yztan float64) string { zreg, _ := regexp.Compile(`[zZ](-?\d*\.?\d*)`) for i, line := range lines { - gmatch, _ := regexp.MatchString(`G[0-1]`, line) + gmatch, _ := regexp.MatchString(`^\s*G[0-1]`, line) if gmatch { // find X, Y, and Y coords in line