Skip to content

Commit 9da6d8d

Browse files
committed
chore: updated license marks in source files
Signed-off-by: Frederic BIDON <[email protected]>
1 parent 3c1111c commit 9da6d8d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+284
-744
lines changed

.golangci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ linters:
1616
- godox
1717
- gosmopolitan
1818
- inamedparam
19-
#- intrange # disabled while < go1.22
19+
- intrange
2020
- ireturn
2121
- lll
2222
- musttag

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@
77

88
The object model for OpenAPI specification documents.
99

10+
## Licensing
11+
12+
This library ships under the [SPDX-License-Identifier: Apache-2.0](./LICENSE).
13+
1014
### FAQ
1115

1216
* What does this do?

auth_test.go

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,5 @@
1-
// Copyright 2015 go-swagger maintainers
2-
//
3-
// Licensed under the Apache License, Version 2.0 (the "License");
4-
// you may not use this file except in compliance with the License.
5-
// You may obtain a copy of the License at
6-
//
7-
// http://www.apache.org/licenses/LICENSE-2.0
8-
//
9-
// Unless required by applicable law or agreed to in writing, software
10-
// distributed under the License is distributed on an "AS IS" BASIS,
11-
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12-
// See the License for the specific language governing permissions and
13-
// limitations under the License.
1+
// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers
2+
// SPDX-License-Identifier: Apache-2.0
143

154
package spec
165

cache.go

Lines changed: 11 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,28 @@
1-
// Copyright 2015 go-swagger maintainers
2-
//
3-
// Licensed under the Apache License, Version 2.0 (the "License");
4-
// you may not use this file except in compliance with the License.
5-
// You may obtain a copy of the License at
6-
//
7-
// http://www.apache.org/licenses/LICENSE-2.0
8-
//
9-
// Unless required by applicable law or agreed to in writing, software
10-
// distributed under the License is distributed on an "AS IS" BASIS,
11-
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12-
// See the License for the specific language governing permissions and
13-
// limitations under the License.
1+
// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers
2+
// SPDX-License-Identifier: Apache-2.0
143

154
package spec
165

176
import (
7+
"maps"
188
"sync"
199
)
2010

2111
// ResolutionCache a cache for resolving urls
2212
type ResolutionCache interface {
23-
Get(string) (interface{}, bool)
24-
Set(string, interface{})
13+
Get(string) (any, bool)
14+
Set(string, any)
2515
}
2616

2717
type simpleCache struct {
2818
lock sync.RWMutex
29-
store map[string]interface{}
19+
store map[string]any
3020
}
3121

3222
func (s *simpleCache) ShallowClone() ResolutionCache {
33-
store := make(map[string]interface{}, len(s.store))
23+
store := make(map[string]any, len(s.store))
3424
s.lock.RLock()
35-
for k, v := range s.store {
36-
store[k] = v
37-
}
25+
maps.Copy(store, s.store)
3826
s.lock.RUnlock()
3927

4028
return &simpleCache{
@@ -43,7 +31,7 @@ func (s *simpleCache) ShallowClone() ResolutionCache {
4331
}
4432

4533
// Get retrieves a cached URI
46-
func (s *simpleCache) Get(uri string) (interface{}, bool) {
34+
func (s *simpleCache) Get(uri string) (any, bool) {
4735
s.lock.RLock()
4836
v, ok := s.store[uri]
4937

@@ -52,7 +40,7 @@ func (s *simpleCache) Get(uri string) (interface{}, bool) {
5240
}
5341

5442
// Set caches a URI
55-
func (s *simpleCache) Set(uri string, data interface{}) {
43+
func (s *simpleCache) Set(uri string, data any) {
5644
s.lock.Lock()
5745
s.store[uri] = data
5846
s.lock.Unlock()
@@ -80,7 +68,7 @@ func initResolutionCache() {
8068
}
8169

8270
func defaultResolutionCache() *simpleCache {
83-
return &simpleCache{store: map[string]interface{}{
71+
return &simpleCache{store: map[string]any{
8472
"http://swagger.io/v2/schema.json": MustLoadSwagger20Schema(),
8573
"http://json-schema.org/draft-04/schema": MustLoadJSONSchemaDraft04(),
8674
}}

cache_test.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers
2+
// SPDX-License-Identifier: Apache-2.0
3+
14
package spec
25

36
import (

circular_test.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers
2+
// SPDX-License-Identifier: Apache-2.0
3+
14
package spec
25

36
import (

contact_info.go

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,5 @@
1-
// Copyright 2015 go-swagger maintainers
2-
//
3-
// Licensed under the Apache License, Version 2.0 (the "License");
4-
// you may not use this file except in compliance with the License.
5-
// You may obtain a copy of the License at
6-
//
7-
// http://www.apache.org/licenses/LICENSE-2.0
8-
//
9-
// Unless required by applicable law or agreed to in writing, software
10-
// distributed under the License is distributed on an "AS IS" BASIS,
11-
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12-
// See the License for the specific language governing permissions and
13-
// limitations under the License.
1+
// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers
2+
// SPDX-License-Identifier: Apache-2.0
143

154
package spec
165

contact_info_test.go

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,5 @@
1-
// Copyright 2015 go-swagger maintainers
2-
//
3-
// Licensed under the Apache License, Version 2.0 (the "License");
4-
// you may not use this file except in compliance with the License.
5-
// You may obtain a copy of the License at
6-
//
7-
// http://www.apache.org/licenses/LICENSE-2.0
8-
//
9-
// Unless required by applicable law or agreed to in writing, software
10-
// distributed under the License is distributed on an "AS IS" BASIS,
11-
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12-
// See the License for the specific language governing permissions and
13-
// limitations under the License.
1+
// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers
2+
// SPDX-License-Identifier: Apache-2.0
143

154
package spec
165

@@ -33,7 +22,7 @@ var contactInfo = ContactInfo{ContactInfoProps: ContactInfoProps{
3322
Name: "wordnik api team",
3423
URL: "http://developer.wordnik.com",
3524
36-
}, VendorExtensible: VendorExtensible{Extensions: map[string]interface{}{"x-teams": "test team"}}}
25+
}, VendorExtensible: VendorExtensible{Extensions: map[string]any{"x-teams": "test team"}}}
3726

3827
func TestIntegrationContactInfo(t *testing.T) {
3928
b, err := json.MarshalIndent(contactInfo, "", "\t")

debug.go

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,5 @@
1-
// Copyright 2015 go-swagger maintainers
2-
//
3-
// Licensed under the Apache License, Version 2.0 (the "License");
4-
// you may not use this file except in compliance with the License.
5-
// You may obtain a copy of the License at
6-
//
7-
// http://www.apache.org/licenses/LICENSE-2.0
8-
//
9-
// Unless required by applicable law or agreed to in writing, software
10-
// distributed under the License is distributed on an "AS IS" BASIS,
11-
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12-
// See the License for the specific language governing permissions and
13-
// limitations under the License.
1+
// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers
2+
// SPDX-License-Identifier: Apache-2.0
143

154
package spec
165

@@ -40,7 +29,7 @@ func debugOptions() {
4029
specLogger = log.New(os.Stdout, "spec:", log.LstdFlags)
4130
}
4231

43-
func debugLog(msg string, args ...interface{}) {
32+
func debugLog(msg string, args ...any) {
4433
// A private, trivial trace logger, based on go-openapi/spec/expander.go:debugLog()
4534
if Debug {
4635
_, file1, pos1, _ := runtime.Caller(1)

debug_test.go

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,5 @@
1-
// Copyright 2015 go-swagger maintainers
2-
//
3-
// Licensed under the Apache License, Version 2.0 (the "License");
4-
// you may not use this file except in compliance with the License.
5-
// You may obtain a copy of the License at
6-
//
7-
// http://www.apache.org/licenses/LICENSE-2.0
8-
//
9-
// Unless required by applicable law or agreed to in writing, software
10-
// distributed under the License is distributed on an "AS IS" BASIS,
11-
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12-
// See the License for the specific language governing permissions and
13-
// limitations under the License.
1+
// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers
2+
// SPDX-License-Identifier: Apache-2.0
143

154
package spec
165

0 commit comments

Comments
 (0)