Skip to content

ockibagusp/golang-website-example

Repository files navigation

golang-website-example

Golang Echo and html template.

move GitHub repository for hello to golang-website-example

Visual Studio Code

Run and Debug: launch.json.

Getting Started

First, clone the repo:

$ git clone https://github.com/ockibagusp/golang-website-example.git

Repo dep

$ make dep

Setting MySQL database

Database

file: golang-website-example.sql -> new database: golang-website-example

Testing

file: golang-website-example.sql -> new database: golang-website-example-test

Users Table

Username Password is Admin
admin admin123 yes
sugriwa user123 no
subali user123 no

Running app

Compile and run Go program

$ make run

or,

Build compiles the packages

$ make build
  • On Linux or Mac:

    $ ./main
    
  • On Windows:

    $ main.exe
    

Router

This using router.

Test the packages

Example,

test all flag

$ make test

test controller flag

$ make test-ctrl

or, verbose output (-v) flag:

test verbose all flag

$ make test-verbose

test verbose controller flag

$ make test-verbose-ctrl

or, cover all flag

test cover

$ make cover

cover show flag:

$ make cover-show

cover html flag:

$ make cover-html

cover select function (-func) flag:

$ make cover-func

Air: cloud Live reload for Go apps

Air is yet another live-reloading command line utility for Go applications in development.

Live Server (npm)

Live Server this is a little development server with live reload capability. Use it for hacking your HTML/JavaScript/CSS files, but not for deploying the final site.

TODO List

  • too much

Golang:

  • go version go1.20.3

MySQL:

  • Active Instance: MySQL 8.0.32

  • MySQL Workbench Community (GPL) version 8.0.33 CE build 2947366 (64 bit)

Bahasa Indonesia

Saya sendang berjuang sembuh dari Stroke pada 03 Oktober 2018-hari ini. Saya dirilis 7 Januari 2020 meng-coding sedikit lupa. Mulai dari Bahasa Indonesia nol sampai saat ini; sekarang sedikit lupa. Sama, Bahasa Inggris nol sampai saat ini; sekarang banyak sulit. Belajar lagi. Insya Allah, perlahan-lahan sembuh. Aamiin.

Allah itu baik. 🙂

English (translate[.]google[.]co[.]id)

I am currently struggling to recover from a stroke on October 3, 2018-today. I released January 7 2020 coding was a little forgotten. Starting from Indonesian zero until now; now a little forgot. Same, English zero so far; now much difficult. Study more. Insya Allah, slowly healed. Aamiin.

Allah is good. 🙂


Copyright © 2020 by Ocki Bagus Pratama