golang-simple-html-generator

command module
v0.0.0-...-0059a22 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 5, 2020 License: MIT Imports: 3 Imported by: 0

README

Simple HTML generator with Golang

Generate a simple HTML from template.

Template file

index.html

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Code Practice with Golang</title>
</head>
<body>
    <p>Hello {{.Name}}</p>
    <p>Coupon: {{.Coupon}}</p>
    <p>Amount: {{.Amount}}</p>
    
</body>
</html>

Result of generated file

index_gen.html

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Code Practice with Golang</title>
</head>
<body>
    <p>Hello Quan Vu</p>
    <p>Coupon: AIX1000</p>
    <p>Amount: 5000</p>
    
</body>
</html>

Run it

go run main.go

Enjoy!

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL