Skip to content

Commit

Permalink
Bump up Go to 1.19.2 (#425)
Browse files Browse the repository at this point in the history
* Bump up Go to 1.19.2

* Bump up golangci-lint to 1.50.0 and fix lint errors
  • Loading branch information
hackerwins authored Oct 8, 2022
1 parent e96be59 commit 3d3123f
Show file tree
Hide file tree
Showing 56 changed files with 162 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
strategy:
matrix:
go_version:
- '1.18'
- 1.19.2
runs-on: ubuntu-latest
steps:

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/docker-publish-latest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ jobs:
runs-on: ubuntu-latest
steps:

- name: Set up Go 1.x
- name: Set up Go 1.19.2
uses: actions/setup-go@v2
with:
go-version: 1.18
go-version: 1.19.2

- name: Check out code
uses: actions/checkout@v2
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ jobs:
runs-on: ubuntu-latest
steps:

- name: Set up Go 1.x
- name: Set up Go 1.19.2
uses: actions/setup-go@v2
with:
go-version: 1.18
go-version: 1.19.2

- name: Check out code
uses: actions/checkout@v2
Expand Down
5 changes: 5 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,8 @@ linters-settings:

issues:
exclude-use-default: false
# Excluding configuration per-path, per-linter, per-text and per-source
exclude-rules:
- text: "G112:"
linters:
- gosec
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ default: help
tools: ## install tools for developing yorkie
go install github.com/gogo/protobuf/[email protected]
go install github.com/gogo/protobuf/[email protected]
go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.46.2
go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.50.0

proto: ## generate proto files
protoc \
Expand Down
1 change: 1 addition & 0 deletions admin/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
* limitations under the License.
*/

// Package admin provides the client for the admin service.
package admin

import (
Expand Down
2 changes: 2 additions & 0 deletions api/converter/converter.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
* limitations under the License.
*/

// Package converter provides the converter for converting model to
// Protobuf, bytes and vice versa.
package converter

import "errors"
Expand Down
2 changes: 2 additions & 0 deletions api/types/id.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
* limitations under the License.
*/

// Package types provides the types used in the Yorkie API. This package is
// used by both the server and the client.
package types

import (
Expand Down
2 changes: 2 additions & 0 deletions client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
* limitations under the License.
*/

// Package client provides the client implementation of Yorkie. It is used to
// connect to the server and attach documents.
package client

import (
Expand Down
1 change: 1 addition & 0 deletions cmd/yorkie/commands.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
* limitations under the License.
*/

// Package main is the entry point of the Yorkie CLI.
package main

import (
Expand Down
1 change: 1 addition & 0 deletions cmd/yorkie/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
* limitations under the License.
*/

// Package config provides the configuration for Admin server.
package config

import (
Expand Down
1 change: 1 addition & 0 deletions cmd/yorkie/document/document.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
* limitations under the License.
*/

// Package document provides the document command.
package document

import "github.com/spf13/cobra"
Expand Down
1 change: 1 addition & 0 deletions cmd/yorkie/project/project.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
* limitations under the License.
*/

// Package project provides the project command.
package project

import "github.com/spf13/cobra"
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/yorkie-team/yorkie

go 1.18
go 1.19

require (
bou.ke/monkey v1.0.2
Expand Down
17 changes: 17 additions & 0 deletions internal/version/version.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
/*
* Copyright 2022 The Yorkie Authors. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

// Package version provides the version information of Yorkie.
package version

// At build time, the versions is replaced with the current version using the -X linker flag
Expand Down
1 change: 1 addition & 0 deletions pkg/cache/cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
* https://github.com/kubernetes/kubernetes/blob/master/staging/src/k8s.io/apimachinery/pkg/util/cache/lruexpirecache.go
*/

// Package cache provides a cache implementation.
package cache

import (
Expand Down
2 changes: 2 additions & 0 deletions pkg/document/change/change.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
* limitations under the License.
*/

// Package change provides the implementation of Change. Change is a set of
// operations that can be applied to a document.
package change

import (
Expand Down
3 changes: 3 additions & 0 deletions pkg/document/crdt/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@
* limitations under the License.
*/

// Package crdt provides the implementation of the CRDT data structure.
// The CRDT data structure is a data structure that can be replicated and
// shared among multiple replicas.
package crdt

import (
Expand Down
1 change: 1 addition & 0 deletions pkg/document/document.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
* limitations under the License.
*/

// Package document provides JSON-like document(CRDT) implementation.
package document

import (
Expand Down
1 change: 1 addition & 0 deletions pkg/document/json/json.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
* limitations under the License.
*/

// Package json provides the JSON document implementation.
package json

import "github.com/yorkie-team/yorkie/pkg/document/crdt"
Expand Down
1 change: 1 addition & 0 deletions pkg/document/key/key.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
* limitations under the License.
*/

// Package key provides the key implementation of the document.
package key

// Key represents a document key.
Expand Down
2 changes: 2 additions & 0 deletions pkg/document/operations/operation.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
* limitations under the License.
*/

// Package operations implements the operations that can be executed on the
// document.
package operations

import (
Expand Down
1 change: 1 addition & 0 deletions pkg/document/time/ticket.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
* limitations under the License.
*/

// Package time provides logical clock and ticket for document.
package time

import (
Expand Down
1 change: 1 addition & 0 deletions pkg/llrb/llrb.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
* limitations under the License.
*/

// Package llrb provides a Left-leaning Red-Black tree implementation.
package llrb

import (
Expand Down
1 change: 1 addition & 0 deletions pkg/pq/priority_queue.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
* limitations under the License.
*/

// Package pq provides the priority queue implementation.
package pq

import (
Expand Down
6 changes: 4 additions & 2 deletions pkg/splay/splay.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
* limitations under the License.
*/

// Package splay provides splay tree implementation. It is used to implement
// List by using splay tree.
package splay

import (
Expand Down Expand Up @@ -85,8 +87,7 @@ func (t *Node[V]) hasLinks() bool {
}

// Tree is weighted binary search tree which is based on Splay tree.
// original paper on Splay Trees:
// - https://www.cs.cmu.edu/~sleator/papers/self-adjusting.pdf
// original paper on Splay Trees: https://www.cs.cmu.edu/~sleator/papers/self-adjusting.pdf
type Tree[V Value] struct {
root *Node[V]
}
Expand Down Expand Up @@ -388,6 +389,7 @@ func (t *Tree[V]) rightmost() *Node[V] {
return node
}

// Len returns the size of this Tree.
func (t *Tree[V]) Len() int {
if t.root == nil {
return 0
Expand Down
4 changes: 3 additions & 1 deletion pkg/units/duration.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
* https://github.com/docker/go-units/blob/master/duration.go
*/

// Package units provides a set of functions to convert between bytes and
// human-readable formats.
package units

import (
Expand All @@ -25,7 +27,7 @@ import (
)

// HumanDuration returns a human-readable approximation of a duration
// (eg. "About a minute", "4 hours ago", etc.).
// (e.g. "About a minute", "4 hours ago", etc.).
func HumanDuration(d time.Duration) string {
if seconds := int(d.Seconds()); seconds < 1 {
return "Less than a second"
Expand Down
1 change: 1 addition & 0 deletions server/admin/auth/token_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
* limitations under the License.
*/

// Package auth provides the authentication and authorization of the admin server.
package auth

import (
Expand Down
1 change: 1 addition & 0 deletions server/admin/interceptors/default.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
* limitations under the License.
*/

// Package interceptors provides interceptors for Admin server.
package interceptors

import (
Expand Down
1 change: 1 addition & 0 deletions server/admin/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
* limitations under the License.
*/

// Package admin provides the admin server.
package admin

import (
Expand Down
3 changes: 3 additions & 0 deletions server/backend/backend.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@
* limitations under the License.
*/

// Package backend provides the backend implementation of the Yorkie.
// This package is responsible for managing the database and other
// resources required to run Yorkie.
package backend

import (
Expand Down
18 changes: 18 additions & 0 deletions server/backend/background/background.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
/*
* Copyright 2022 The Yorkie Authors. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

// Package background provides the background service. This service is used to
// manage the background goroutines in the backend.
package background

import (
Expand Down
1 change: 1 addition & 0 deletions server/backend/database/database.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
* limitations under the License.
*/

// Package database provides the database interface for the Yorkie backend.
package database

import (
Expand Down
1 change: 1 addition & 0 deletions server/backend/database/memory/database.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
* limitations under the License.
*/

// Package memory implements the database interface using in-memory database.
package memory

import (
Expand Down
1 change: 1 addition & 0 deletions server/backend/database/mongo/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
* limitations under the License.
*/

// Package mongo implements database interfaces using MongoDB.
package mongo

import (
Expand Down
3 changes: 3 additions & 0 deletions server/backend/housekeeping/housekeeping.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@
* limitations under the License.
*/

// Package housekeeping provides the housekeeping service. The housekeeping
// service is responsible for deactivating clients that have not been used for
// a long time.
package housekeeping

import (
Expand Down
1 change: 1 addition & 0 deletions server/backend/sync/coordinator.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
* limitations under the License.
*/

// Package sync provides the synchronization primitives for the server.
package sync

import (
Expand Down
2 changes: 2 additions & 0 deletions server/backend/sync/etcd/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
* limitations under the License.
*/

// Package etcd provides etcd implementation of the sync. It is used to
// synchronize the state of the cluster.
package etcd

import (
Expand Down
1 change: 1 addition & 0 deletions server/backend/sync/memory/coordinator.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
* limitations under the License.
*/

// Package memory provides the memory implementation of the sync package.
package memory

import (
Expand Down
Loading

0 comments on commit 3d3123f

Please sign in to comment.