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(`}`),
  ],
));

Readme

Keywords

Package Sidebar

Install

npm i osh-code-go

Weekly Downloads

0

Version

0.3.0

License

MIT

Last publish

Collaborators

  • localvoid