golangcookbook.github.io

Golang Cookbook

  • 所有者: superorbital/golangcookbook.github.io
  • 平台:
  • 許可證: Other
  • 分類:
  • 主題:
  • 喜歡:
    0
      比較:

Github星跟蹤圖

Go Cookbook

Source for the Go Cookbook, a
community build and contributed collection of practical
recipes for real world Golang development, supported by
SuperOrbital.

Contributing

The Go Cookbook is supported by
SuperOrbital, but built by the
community, so your contributions are very welcome. Just send
a pull request for any changes or additions.

Adding a New Recipe

Recipes are generated from the _data/chapters.yml
file
,
which is used to build the index
page
.
The chapters.yml file format is:

- title: Strings
  recipes:
  - title: Concatenating Strings
    path: /chapters/strings/concatenation
    wip: true
  - title: Detecting a Substring
    path: /chapters/strings/detecting
  - title: Detecting All Substrings
    path: false

Specifying wip: true puts "[Work in progress]" in front of
the recipe in the index. Setting path: false causes the
recipe to be listed without a link.

Recipe Format

Recipe files have a couple of required properties, specified
in the preamble like such:

---
title: Processing a String One Word or Character at a Time
question: Given a string, how do I break it into words or characters and process each one in turn?
---

Also, to show example code, recipes can make use of the {% include example.html example="filename" %} helper. This will
include both filename.go as example source code, and
filename.expected.escaped as the output of that code. If
you're curious, here's the definition for that
helper
.
The filename.expected.escaped files are automatically
generated by the ./run_tests script, described below.

Run locally

This project uses Docker for local development. Once you
have Docker installed:

$ ./run server
$ open http://localhost:4000

Run the tests

$ ./run tests

The run_tests script not only runs the tests, but also
ensures that the .expected, .go.escaped, and
.expected.escaped files are in place. These files are then
used in the recipe templates to ensure all examples are up to
date and correct.

License

Creative Commons
License

The Go Cookbook copyright
SuperOrbital, and is licensed under
a Creative Commons Attribution-NonCommercial-ShareAlike 4.0
International
License
.

主要指標

概覽
名稱與所有者superorbital/golangcookbook.github.io
主編程語言CSS
編程語言Ruby (語言數: 7)
平台
許可證Other
所有者活动
創建於2015-02-28 09:52:32
推送於2024-08-06 23:57:03
最后一次提交2024-08-02 18:47:10
發布數0
用户参与
星數413
關注者數32
派生數63
提交數76
已啟用問題?
問題數11
打開的問題數9
拉請求數6
打開的拉請求數6
關閉的拉請求數10
项目设置
已啟用Wiki?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?