osh-code-go
TypeScript icon, indicating that this package has built-in type declarations

0.3.0 • Public • Published

osh-code-go provides a set of basic components for generating Go program code.

osh-code preset

interface GOCodeOptions {
  readonly removeComments: boolean;
}
function goCode(options: Partial<GOCodeOptions> | undefined, children: TChildren): ComponentNode<GOCodeProps>;
import { renderToString } from "osh";
import { line, docComment } from "osh-code";
import { goCode } from "osh-code-go";
 
renderToString(goCode(
  undefined,
  [
    docComment(
      line("Doc comment"),
    ),
    line(`func main() {`),
    indent(line(`fmt.Printf("Hello Go")`)),
    line(`}`),
  ],
));

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.3.0
    2
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 0.3.0
    2

Package Sidebar

Install

npm i osh-code-go

Weekly Downloads

2

Version

0.3.0

License

MIT

Last publish

Collaborators

  • localvoid