8000 Fix(lint): Address multiple linting issues across the codebase by CaliLuke · Pull Request #990 · cayleygraph/cayley · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Fix(lint): Address multiple linting issues across the codebase #990

8000 New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 10 commits into
base: master
Choose a base branch
from

Conversation

CaliLuke
Copy link
@CaliLuke CaliLuke commented Jun 20, 2025

This commit addresses a series of linting issues identified by golangci-lint, improving code quality and consistency.

Key changes include:

  • Error Handling:

    • Correctly handle errors returned from functions such as pprof.StartCPUProfile, json.Unmarshal, w.Write, encoder.Encode, decoder.Decode, tx.Commit, and os.MkdirAll.
    • Ignored errors from tx.Rollback as the transaction is already in a failed state.
  • Deprecated Code:

    • Replaced deprecated io/ioutil with the os package.
    • Replaced deprecated quad.Raw and quad.MakeRaw with quad.IRI and quad.MakeIRI respectively.
  • Code Cleanup:

    • Removed unused variables and functions to improve code readability.
    • Eliminated ineffectual assignments.
  • Tooling:

    • Introduced a run_linter.sh script to streamline the linting process.

This change is Reviewable

This commit addresses a series of linting issues identified by golangci-lint, improving code quality and consistency.

Key changes include:

- **Error Handling:**
  - Correctly handle errors returned from functions such as `pprof.StartCPUProfile`, `json.Unmarshal`, `w.Write`, `encoder.Encode`, `decoder.Decode`, `tx.Commit`, and `os.MkdirAll`.
  - Ignored errors from `tx.Rollback` as the transaction is already in a failed state.

- **Deprecated Code:**
  - Replaced deprecated `io/ioutil` with the `os` package.
  - Replaced deprecated `quad.Raw` and `quad.MakeRaw` with `quad.IRI` and `quad.MakeIRI` respectively.

- **Code Cleanup:**
  - Removed unused variables and functions to improve code readability.
  - Eliminated ineffectual assignments.

- **Tooling:**
  - Introduced a `run_linter.sh` script to streamline the linting process.
@CaliLuke CaliLuke requested review from dennwc and eraserhd as code owners June 20, 2025 18:30
CaliLuke added 9 commits June 20, 2025 12:19
This commit resolves a batch of 7 linting errors found in the /examples directory to improve code quality and maintainability.

Key changes include:
- Replaced the deprecated `io/ioutil` package with `os` for temporary directory creation in `hello_bolt/main.go` and `hello_schema/main.go`.
- Removed an unused `rdfType` field from the Person struct in `hello_schema/main.go`.
- Replaced `nil` context arguments with `context.TODO()` in `hello_schema/main.go` and `hello_world/main.go` to adhere to best practices for context propagation.
Copy link
Member
@dennwc dennwc left a comment

Choose a reason for hiding this comment

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

This PR clearly breaks a few things in the code. Looks automated to me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0