Skip to content
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 43 additions & 3 deletions CONTRIBUTING.md
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and can you fix here as follow up for #587?

  • - [ ] [line-bot-sdk-go module](https://pkg.go.dev/github.com/line/line-bot-sdk-go)
  • https://pkg.go.dev/github.com/line/line-bot-sdk-go -> https://pkg.go.dev/github.com/line/line-bot-sdk-go/v8

Original file line number Diff line number Diff line change
@@ -1,14 +1,54 @@
## How to contribute to LINE Bot SDK for Go project
# How to contribute to LINE Bot SDK for Go project

First of all, thank you so much for taking your time to contribute! LINE Bot SDK for Go is not very different from any other open
source projects you are aware of. It will be amazing if you could help us by doing any of the following:

- File an issue in [the issue tracker](https://github.com/line/line-bot-sdk-go/issues) to report bugs and propose new features and
improvements.
- Ask a question using [the issue tracker](https://github.com/line/line-bot-sdk-go/issues).
- Ask a question using [the issue tracker](https://github.com/line/line-bot-sdk-go/issues) (__Please ask only about this SDK__).
- Contribute your work by sending [a pull request](https://github.com/line/line-bot-sdk-go/pulls).

### Contributor license agreement
## Development

### Install dependencies

Run `go mod tidy` to install all dependencies for development.
Copy link
Contributor

@Yang-33 Yang-33 Jul 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok but this library won't use any dependencies, so I think it's not necessary.


### Understand the project structure

The project structure is as follows:

- `/linebot`: The main library code, organized into sub-packages by API functionality.
- `/examples`: Example projects that demonstrate how to use the library.
- `/generator`: OpenAPI-based code generation tools and templates.
- `/script`: Utility scripts for development.

### Edit OpenAPI templates

Almost all code is generated with OpenAPI Generator based on [line-openapi](https://github.com/line/line-openapi)'s YAML files.
Thus, you cannot edit most code under the `/linebot` directory directly.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why only this repository uses / prefix?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ops, just mistake


You need to edit the custom generator templates under the `generator/src/main/resources` directory instead.

After editing the templates, run the `generate-code.py` script to generate the code, and then commit all affected files.
If not, CI status will fail.

When you update code, be sure to check consistencies between generated code and your changes.

### Add unit tests

We use Go's built-in testing framework. To run all tests with race detection and coverage reporting: `bash script/codecov.sh`

Especially for bug fixes, please follow this flow for testing and development:
1. Write a test before making changes to the library and confirm that the test fails.
2. Modify the code of the library.
3. Run the test again and confirm that it passes thanks to your changes.

### Run your code in your local

You can use the [example projects](examples/) to test your changes locally before submitting a pull request.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oops, this document should explain we want contributors to write documentation in code.
can you add the section?

hint: https://github.com/line/line-bot-sdk-ruby/blob/6cef3f865abc81323eb5a1a047b0bcae4df234d0/CONTRIBUTING.md?plain=1#L65

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you mean like this?
Add Documentation section

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thank you!

## Contributor license agreement

When you are sending a pull request and it's a non-trivial change beyond fixing typos, please make sure to sign
[the ICLA (individual contributor license agreement)](https://cla-assistant.io/line/line-bot-sdk-go). Please
Expand Down