// Five Example: Native Go Package Usage — NO #pragma BEGINDUMP // // Just IMPORT and use Go packages directly from PRG! // Five generates the bridge code automatically. // // pkg.Func() → direct Go call (gengo emits native Go) // obj:Method() → reflect bridge (runtime GoCall) IMPORT "strings" IMPORT "strconv" IMPORT "fmt" PROCEDURE Main() LOCAL cResult, nVal, cFormatted ? "=== Five Native Go Calls ===" ? // strings.ToUpper — direct Go package call cResult := strings.ToUpper("hello five!") ? "strings.ToUpper:", cResult // strings.Contains ? "strings.Contains('Five is great', 'great'):", strings.Contains("Five is great", "great") // strings.Replace cResult := strings.ReplaceAll("foo-bar-baz", "-", "_") ? "strings.ReplaceAll:", cResult // strings.Split → returns Go slice → auto-converted to Harbour array ? "strings.Split('a,b,c', ','):", strings.Split("a,b,c", ",") // strconv.Atoi — returns (int, error) nVal := strconv.Atoi("42") ? "strconv.Atoi('42'):", nVal // fmt.Sprintf — format strings the Go way cFormatted := fmt.Sprintf("Name: %s, Age: %d, Score: %.1f", "Charles", 30, 98.5) ? "fmt.Sprintf:", cFormatted RETURN