# Go-sugar: a Go superset with check and or syntax - feedback welcome

**URL:** <https://forum.golangbridge.org/t/go-sugar-a-go-superset-with-check-and-or-syntax-feedback-welcome/41898>\
**Category:** Technical Discussion\
**Created:** [May 10, 2026, 9:04pm UTC](https://forum.golangbridge.org/t/go-sugar-a-go-superset-with-check-and-or-syntax-feedback-welcome/41898 "2026-05-10T21:04:19Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![toniphan21](https://forum.golangbridge.org/user_avatar/forum.golangbridge.org/toniphan21/32/17497_2.png) [@toniphan21](https://forum.golangbridge.org/u/toniphan21)\
**Post date:** [May 10, 2026, 9:04pm UTC](https://forum.golangbridge.org/t/go-sugar-a-go-superset-with-check-and-or-syntax-feedback-welcome/41898/1 "2026-05-10T21:04:19Z")

</div>

I’m building **go-sugar** , a superset of Go that compiles `.gos` files to plain `.go` files, with full LSP support via a gopls proxy.

The first two sugars are `check` and `or`:

```auto
// test.gos - go sugar file

func printSum(a, b string) error {
  x := check strconv.Atoi(a)
  y := check strconv.Atoi(b)

  fmt.Printf("%d", x + y)
  return nil
}

func main() {
  name := config.Name or "default"
}

```

compiles to:

```auto
// test.gos.go

func printSum(a, b string) error {
  x, err := strconv.Atoi(a)
  if err != nil {
    return err
  }
  y, err := strconv.Atoi(b)
  if err != nil {
    return err
  }

  fmt.Printf("%d", x + y)
  return nil
}

func main() {
  name := config.Name
  if name == "" {
    name = "default"
  }
}

```

- Inspired by templ - IDE support is a must.
- Each sugar is a plugin, opt-in via a config file.
- `or` performs a zero-value check, type-aware.

Still early, wasm demo and LSP coming soon. What do you think?

---

<div class="post-metadata">

**Author:** ![system](https://forum.golangbridge.org/uploads/default/original/2X/5/5ad234f7c3dbc68b6cc72d338ce4f2973d9fd81c.png) [@system](https://forum.golangbridge.org/u/system)\
**Post date:** [August 8, 2026, 9:04pm UTC](https://forum.golangbridge.org/t/go-sugar-a-go-superset-with-check-and-or-syntax-feedback-welcome/41898/2 "2026-08-08T21:04:55Z")

</div>

Closed on August 8, 2026, 9:04pm UTC

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
