This Rust-based tool generates, compiles, and tests code using LLMs, resolves dependencies, and provides explanations of existing code through embeddings.
module solution
go 1.20
require (
github.com/stretchr/testify v1.8.0
)
main.go
package main
import "fmt"
// Solution adds two integers and returns the result
func Solution(a, b int) int {
return a + b
}
func main() {
result := Solution(1, 2)
fmt.Println("Result:", result)
}
main_test.go
package main
import (
"testing"
"github.com/stretchr/testify/assert"
)
func TestSolution(t *testing.T) {
assert.Equal(t, 3, Solution(1, 2), "1 + 2 should be 3")
assert.Equal(t, -3, Solution(-1, -2), "-1 + -2 should be -3")
// Note: To handle different types, you might need to adjust the function or tests accordingly
}
Launch example
Example query:
Example generation:
go.mod
main.go
main_test.go
Example install dependencies
Example build the project
Example run tests