Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>Go aggregatorNew to Visual Studio Code? Get it now.
Go aggregator

Go aggregator

Lorenzo Tinfena

|
106 installs
| (0) | Free
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

vscode extension

Go aggregator

This extension is intended to be used only by https://github.com/lorenzotinfena/competitive-go, see that for documentation and usage.

Example

main.go

package main

import (
	"fmt"
	"github.com/lorenzotinfena/goji"
)

func main() {
	fmt.Println(goji.GCD(20, 23))
}

github.com/lorenzotinfena/goji/math.go

package goji

func Swap(a, b *int) {
	*a, *b = *b, *a
}

func GCD(a, b int) int {
	if b < a {
		Swap(&a, &b)
	}
	for {
		if a == 0 {
			return b
		}
		r := (b % a)
		b = a
		a = r
	}
}

The extension will generate

output.go

// Generated with https://github.com/lorenzotinfena/go-aggregator
// Original source code:
/*
package main

import (
	"fmt"
	"github.com/lorenzotinfena/goji"
)

func main() {
	fmt.Println(goji.GCD(20, 23))
}
*/

package main

import (
	"fmt"
)

func main() {
	fmt.Println(GCD(20, 23))
}

func Swap(a, b *int) {
	*a, *b = *b, *a
}

func GCD(a, b int) int {
	if b < a {
		Swap(&a, &b)
	}
	for {
		if a == 0 {
			return b
		}
		r := (b % a)
		b = a
		a = r
	}
}
  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft