From b24d3b5e50f7b0e18486d18f0a240d04d254ea73 Mon Sep 17 00:00:00 2001 From: Dmitri Shuralyov Date: Tue, 10 Oct 2023 19:07:48 -0400 Subject: [PATCH 1/3] all: add a go directive, set it to 1.18 Done with: go get go@1.18 toolchain@none go mod tidy go fix ./... Using go1.21.3. Otherwise the module is considered to have an implicit go 1.16 line. While here, drop the by-now-always-satisfied go1.7 build constraint. For golang/go#60268. Change-Id: Ie0216c6f22c5e25321042e1b7bdaa59f3c3ae843 Reviewed-on: https://go-review.googlesource.com/c/time/+/534243 Reviewed-by: Ian Lance Taylor Auto-Submit: Dmitri Shuralyov Reviewed-by: Dmitri Shuralyov LUCI-TryBot-Result: Go LUCI --- go.mod | 2 ++ rate/rate_test.go | 3 --- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 46ac917..176cc09 100644 --- a/go.mod +++ b/go.mod @@ -1 +1,3 @@ module golang.org/x/time + +go 1.18 diff --git a/rate/rate_test.go b/rate/rate_test.go index a063e35..48ebaef 100644 --- a/rate/rate_test.go +++ b/rate/rate_test.go @@ -2,9 +2,6 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//go:build go1.7 -// +build go1.7 - package rate import ( From 883aed519795b30de35e6bc28ec8f681494afa87 Mon Sep 17 00:00:00 2001 From: Mohammed Sohail Date: Mon, 25 Sep 2023 15:23:36 +0800 Subject: [PATCH 2/3] rate: add documentation on Limiter concurrent usage Closes golang/go#17261 Change-Id: Ifeacc8df45fb59e7781ddcc35c2fde0aa80188eb Reviewed-on: https://go-review.googlesource.com/c/time/+/530855 Auto-Submit: Sameer Ajmani Reviewed-by: Michael Knyszek Reviewed-by: Sameer Ajmani LUCI-TryBot-Result: Go LUCI --- rate/rate.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/rate/rate.go b/rate/rate.go index f0e0cf3..8f6c7f4 100644 --- a/rate/rate.go +++ b/rate/rate.go @@ -52,6 +52,8 @@ func Every(interval time.Duration) Limit { // or its associated context.Context is canceled. // // The methods AllowN, ReserveN, and WaitN consume n tokens. +// +// Limiter is safe for simultaneous use by multiple goroutines. type Limiter struct { mu sync.Mutex limit Limit From 5d9ef583af632a0fcf95276fb38326f695c4fd5f Mon Sep 17 00:00:00 2001 From: Russ Cox Date: Tue, 16 Jul 2024 11:35:25 -0400 Subject: [PATCH 3/3] LICENSE: update per Google Legal Very minor tweaks: - Remove (c) pseudosymbol. - Remove "All Rights Reserved." - Change "Google Inc." (no longer exists) to "Google LLC". [git-generate] echo ' ,s/\(c\) // ,s/ All rights reserved.// ,s/Google Inc./Google LLC/ w q ' | sam -d LICENSE Change-Id: Iaff5a0b4df05a69b33e2aa63f42e2476c255952d Reviewed-on: https://go-review.googlesource.com/c/time/+/598529 Auto-Submit: Russ Cox Reviewed-by: Ian Lance Taylor LUCI-TryBot-Result: Go LUCI --- LICENSE | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/LICENSE b/LICENSE index 6a66aea..2a7cf70 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2009 The Go Authors. All rights reserved. +Copyright 2009 The Go Authors. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are @@ -10,7 +10,7 @@ notice, this list of conditions and the following disclaimer. copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - * Neither the name of Google Inc. nor the names of its + * Neither the name of Google LLC nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.