-
-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
43 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,43 @@ | ||
Contributing | ||
## How to contribute | ||
- First, fork this repository | ||
- Second, clone repository in your develop machine | ||
- Finaly, writing code and push/PR to me(hahwul/gee) | ||
|
||
## Writing code | ||
I'm checking the quality of code through Codacy when PR/Merge/Push. If you want to consider code quality in advance, please check the link below (not perfect, but very helpful). | ||
|
||
https://goreportcard.com/report/github.com/hahwul/gee | ||
|
||
e.g: `https://goreportcard.com/report/github.com/{your github account}/gee` | ||
|
||
## Add new flag | ||
First, Add new flag in sturcture in `pkg/model/options.go` | ||
```go | ||
type Options struct { | ||
Files []string | ||
Append bool | ||
// snip | ||
} | ||
``` | ||
Second, Add flag in `main.go` | ||
```go | ||
// e.g | ||
appendOption := flag.Bool("append", false, "Append mode for files") | ||
... | ||
options := model.Options{ | ||
Files: files, | ||
Append: *appendOption, | ||
// snip | ||
} | ||
``` | ||
Finaly, Add logic | ||
```go | ||
if options.Append { | ||
mode = os.O_APPEND | os.O_CREATE | os.O_WRONLY | ||
} | ||
``` | ||
|
||
## Build | ||
``` | ||
go build | ||
``` |