Skip to content

Commit

Permalink
chore: deprecation notice for WithPort()
Browse files Browse the repository at this point in the history
  • Loading branch information
dylanhitt authored and EwenQuim committed Apr 4, 2024
1 parent 836542a commit d228d23
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion options.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ func NewServer(options ...func(*Server)) *Server {
}

defaultOptions := [...]func(*Server){
WithPort(9999),
WithAddr("localhost:9999"),
WithDisallowUnknownFields(true),
WithSerializer(SendJSON),
WithErrorSerializer(SendJSONError),
Expand Down Expand Up @@ -226,6 +226,7 @@ func WithDisallowUnknownFields(b bool) func(*Server) {
// WithPort sets the port of the server. For example, 8080.
// If not specified, the default port is 9999.
// If you want to use a different address, use [WithAddr] instead.
// Deprecated: Please use fuego.WithAddr(addr string)
func WithPort(port int) func(*Server) {
return func(s *Server) { s.Server.Addr = fmt.Sprintf("localhost:%d", port) }
}
Expand Down

0 comments on commit d228d23

Please sign in to comment.