Skip to content

Commit 1e50891

Browse files
committed
fix: replace deprecated ioutil.ReadAll with io.ReadAll in healthcheck test
The change was made to update the deprecated ioutil.ReadAll function with the recommended io.ReadAll function in the healthcheck test. This ensures that the codebase stays up to date with best practices and avoids potential issues with deprecated functions in the future.
1 parent 87a1ad3 commit 1e50891

File tree

2 files changed

+3
-215
lines changed

2 files changed

+3
-215
lines changed

.gitignore

+1-213
Original file line numberDiff line numberDiff line change
@@ -1,213 +1 @@
1-
2-
# Created by https://www.gitignore.io/api/xcode,intellij,osx,windows,ruby,node
3-
4-
### Xcode ###
5-
# Xcode
6-
#
7-
# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore
8-
9-
## Build generated
10-
build/
11-
DerivedData
12-
13-
## Various settings
14-
*.pbxuser
15-
!default.pbxuser
16-
*.mode1v3
17-
!default.mode1v3
18-
*.mode2v3
19-
!default.mode2v3
20-
*.perspectivev3
21-
!default.perspectivev3
22-
xcuserdata
23-
24-
## Other
25-
*.xccheckout
26-
*.moved-aside
27-
*.xcuserstate
28-
*.icloud
29-
30-
31-
### Intellij ###
32-
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm
33-
34-
*.iml
35-
36-
## Directory-based project format:
37-
.idea/
38-
# if you remove the above rule, at least ignore the following:
39-
40-
# User-specific stuff:
41-
# .idea/workspace.xml
42-
# .idea/tasks.xml
43-
# .idea/dictionaries
44-
# .idea/shelf
45-
46-
# Sensitive or high-churn files:
47-
# .idea/dataSources.ids
48-
# .idea/dataSources.xml
49-
# .idea/sqlDataSources.xml
50-
# .idea/dynamic.xml
51-
# .idea/uiDesigner.xml
52-
53-
# Gradle:
54-
# .idea/gradle.xml
55-
# .idea/libraries
56-
57-
# Mongo Explorer plugin:
58-
# .idea/mongoSettings.xml
59-
60-
## File-based project format:
61-
*.ipr
62-
*.iws
63-
64-
## Plugin-specific files:
65-
66-
# IntelliJ
67-
/out/
68-
69-
# mpeltonen/sbt-idea plugin
70-
.idea_modules/
71-
72-
# JIRA plugin
73-
atlassian-ide-plugin.xml
74-
75-
# Crashlytics plugin (for Android Studio and IntelliJ)
76-
com_crashlytics_export_strings.xml
77-
crashlytics.properties
78-
crashlytics-build.properties
79-
fabric.properties
80-
81-
82-
### OSX ###
83-
.DS_Store
84-
.AppleDouble
85-
.LSOverride
86-
87-
# Icon must end with two \r
88-
Icon
89-
90-
91-
# Thumbnails
92-
._*
93-
94-
# Files that might appear in the root of a volume
95-
.DocumentRevisions-V100
96-
.fseventsd
97-
.Spotlight-V100
98-
.TemporaryItems
99-
.Trashes
100-
.VolumeIcon.icns
101-
102-
# Directories potentially created on remote AFP share
103-
.AppleDB
104-
.AppleDesktop
105-
Network Trash Folder
106-
Temporary Items
107-
.apdisk
108-
109-
110-
### Windows ###
111-
# Windows image file caches
112-
Thumbs.db
113-
ehthumbs.db
114-
115-
# Folder config file
116-
Desktop.ini
117-
118-
# Recycle Bin used on file shares
119-
$RECYCLE.BIN/
120-
121-
# Windows Installer files
122-
*.cab
123-
*.msi
124-
*.msm
125-
*.msp
126-
127-
# Windows shortcuts
128-
*.lnk
129-
130-
131-
### Ruby ###
132-
*.gem
133-
*.rbc
134-
/.config
135-
/coverage/
136-
/InstalledFiles
137-
/pkg/
138-
/spec/reports/
139-
/spec/examples.txt
140-
/test/tmp/
141-
/test/version_tmp/
142-
/tmp/
143-
144-
## Specific to RubyMotion:
145-
.dat*
146-
.repl_history
147-
build/
148-
149-
## Documentation cache and generated files:
150-
/.yardoc/
151-
/_yardoc/
152-
/doc/
153-
/rdoc/
154-
155-
## Environment normalization:
156-
/.bundle/
157-
/vendor/bundle
158-
/lib/bundler/man/
159-
160-
# for a library or gem, you might want to ignore these files since the code is
161-
# intended to run in multiple environments; otherwise, check them in:
162-
# Gemfile.lock
163-
# .ruby-version
164-
# .ruby-gemset
165-
166-
# unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
167-
.rvmrc
168-
169-
170-
### Node ###
171-
# Logs
172-
logs
173-
*.log
174-
npm-debug.log*
175-
176-
# Runtime data
177-
pids
178-
*.pid
179-
*.seed
180-
181-
# Directory for instrumented libs generated by jscoverage/JSCover
182-
lib-cov
183-
184-
# Coverage directory used by tools like istanbul
185-
coverage
186-
187-
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
188-
.grunt
189-
190-
# node-waf configuration
191-
.lock-wscript
192-
193-
# Compiled binary addons (http://nodejs.org/api/addons.html)
194-
build/Release
195-
196-
# Dependency directory
197-
# https://docs.npmjs.com/misc/faq#should-i-check-my-node-modules-folder-into-git
198-
node_modules
199-
200-
# Optional npm cache directory
201-
.npm
202-
203-
# Optional REPL history
204-
.node_repl_history
205-
206-
# General
207-
*.swp
208-
209-
# Pods
210-
Pods/
211-
212-
# Env
213-
.env
1+
test_coverage.txt

healthcheck_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import (
44
"bytes"
55
"encoding/json"
66
"fmt"
7-
"io/ioutil"
7+
"io"
88
"net/http"
99
"net/http/httptest"
1010
"os"
@@ -90,7 +90,7 @@ func TestHTTP(t *testing.T) {
9090
healthcheck.HTTP(response, request)
9191
assert.Equal(t, 200, response.Code)
9292

93-
body, _ := ioutil.ReadAll(response.Body)
93+
body, _ := io.ReadAll(response.Body)
9494
healthy := healthcheck.Health{}
9595
_ = json.Unmarshal(body, &healthy)
9696
assert.Equal(t, test.expect, healthy)

0 commit comments

Comments
 (0)