KO
|
EN
gitlite — search
Search
#typescript
#ai-agents
#ai
#dsh-plugin
#deepseek-harness
#open-source
#cli
#claude-code
#codex
#developer-tools
#react
#windows
terraform-provider-go
★ 42
Open GitHub ↗
Experimental
Download README (.md)
Explore Similar Repositories
freeclash
:
一元机场,老牌机场,每日更新,提供多个订阅地址和高速免费节点,支持V2Ray、VPN、免费机场,无限流量!V2Ray节点分享,兼容v2ray、clash和小火箭!VPN,包括Winxray、2rayNG、BifrostV、Clash、Kitsunebi、V2rayN、V2rayW、Mellow等等。科学上网翻墙白嫖节点,免费梯子,永久免费代理,小飞侠SSR等等服务,让你畅游互联网不再受限!
SentenceVAE
:
Enable Next-sentence Prediction for Large Language Models with Faster Speed, Higher Accuracy and Longer Context
Knowledge-data-evaluation
:
No description available.
wagmi-scw
:
No description available.
igloo
:
Demo for op rollup with decoupling SVM execution layer
// repository documentation
Was this content helpful?
★ 0
(0 ratings)
Select Rating:
★
★
★
★
★
Submit Feedback
Recent Feedback
×
Download README
Do you want to download the
README.md
file for
terraform-provider-go
?
Download (.md)
# terraform-provider-go This is an experimental OpenTofu function provider based on terraform-plugin-go. It allows you to write Go helper functions next to your Tofu code, so that you can use them in your Tofu configuration, in a completely type-safe way. The provider is based on [Yaegi](https://github.com/traefik/yaegi), and most of the Go standard library is available. In OpenTofu 1.7.0-beta1 and upwards you can configure the provider and pass it a Go file to load. - The package name should be `lib` - Exported functions need to start with upper-case letters. - The Tofu-facing name of the function **will be lower-cased**. - It supports simple types, like strings, integers, floats, and booleans. - It also supports complex type, like maps, slices, nullable pointers, and structures. This feature is an experimental preview and is subject to change before the OpenTofu 1.7.0 release. ## Example ```hcl // main.tf provider "go" { go = file("./lib.go") } output "test" { value = provider::go::hello("papaya") } ``` ```go // lib.go package lib func Hello(name string) string { return "Hello, " + name + "!" } ``` Output excerpt: ``` Changes to Outputs: + test = "Hello, papaya!" ``` ## More involved example ```hcl // main.tf provider "go" { go = file("./lib.go") } output "test" { value = provider::go::hello({ name = "papaya", surname = "bacon", }) } ``` ```go // lib.go package lib import ( "fmt" ) type Person struct { // We can let it default to the un-capitalized field name. Name string // Or use a struct tag to specify the object field name explicitly. Surname string `tf:"surname"` } func Hello(person Person) string { return fmt.Sprintf("Hello, %s %s!", person.Name, person.Surname) } ``` Output excerpt: ``` Changes to Outputs: + test = "Hello, papaya bacon!" ``` Moreover, all of this is type-safe and mistakes will be caught by tofu. So passing a number to the function will fail with `object required`, while forgetting e.g. the surname will fail with `attribute "surname" is required`. ## Importing Here's a snippet to require the provider in your OpenTofu configuration: ```hcl terraform { required_providers { go = { source = "registry.opentofu.org/opentofu/go" version = "0.0.1" } } } ```