Skip to content

Commit e63a9f1

Browse files
committed
Merge branch 'YutaOkoshi-feat/add_sesame'
2 parents f582c2a + 512efe4 commit e63a9f1

4 files changed

Lines changed: 33 additions & 4 deletions

File tree

.editorconfig

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# http://editorconfig.org
2+
3+
# this file is the top-most editorconfig file
4+
root = true
5+
6+
# all files
7+
[*]
8+
charset = utf-8
9+
end_of_line = lf
10+
indent_style = space
11+
indent_size = 4
12+
trim_trailing_whitespace = true
13+
insert_final_newline = true
14+
15+
[*.go]
16+
indent_size = 4
17+
indent_style = tab

main.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ func saveImage(filename string, img image.Image) error {
5454

5555
var toppings [6]Topping
5656
var top Topping
57+
var topWithSesame Topping
5758
var bottom Topping
5859

5960
func init() {
@@ -67,6 +68,11 @@ func init() {
6768
log.Fatal(err)
6869
}
6970

71+
topWithSesame.Img, err = loadImage(fs, "/top-sesame.png")
72+
if err != nil {
73+
log.Fatal(err)
74+
}
75+
7076
bottom.Img, err = loadImage(fs, "/bottom.png")
7177
if err != nil {
7278
log.Fatal(err)
@@ -108,16 +114,22 @@ func main() {
108114
var nBurger int
109115
var rInterval float64
110116
var fileName string
117+
var sesame bool
111118

112119
flag.IntVar(&nBurger, "n", 1, "number of big burger")
113120
flag.Float64Var(&rInterval, "i", 1.0, "rate of intervals")
114121
flag.StringVar(&fileName, "o", "", "output image file")
122+
flag.BoolVar(&sesame, "s", false,"buns with sesame")
115123

116124
for i := 0; i < len(toppings); i++ {
117125
flag.IntVar(&toppings[i].Count, toppings[i].Option, toppings[i].Count, fmt.Sprintf("how many %s", toppings[i].Name))
118126
}
119127
flag.Parse()
120128

129+
if sesame{
130+
top = topWithSesame
131+
}
132+
121133
// Count number of unique toppings
122134
uniqueToppingCount := 0
123135
for i := 0; i < len(toppings); i++ {

public/top-sesame.png

19.9 KB
Loading

statik/statik.go

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)